@name isResponseError
@description Common error facility.

@param {Object} response
@param {Function} callback
@returns {boolean} False if `response` has no error and user object.
337725
function isResponseError(response, callback) {
  if(response.error) {
    callback(new Error('Coinjar personal fair_rate api returned error: ' + response.error));
    return true;
  }
  if(!response.body) {
    callback(new Error('Coinjar personal fair_rate api returned error: No response body.'));
    return true;
  }
  return false;
}
430981
function(callback) {

      // Detect server errors
      var t = this, server = t.get('server');
      server.on('clientError', function(err){
        console.error('Client error detected on server', err);
        t.trigger('error', err);
      });
      server.on('close', function(err){
        server.hasEmittedClose = true;
        t.stop();
      });

      // Notify that we've started
      t.isListening = true;
      if (callback) {
        callback(null);
      }
      t.trigger('start');
    }
532782
function clientError(err, res) {
  log('error', err.message, { stack: err.stack });
  // They know it's a 400 already, we don't need to repeat the fact that its an error.
  const message = removePrefix(err.message, ':'),
    code = 400;

  sendDefaultResponseForCode(code, message, res);
}
863864
function (event) {
                // Do nothing if the request has been cancelled.
                if (cancelled) {
                    return;
                }
                // Cleanup the page.
                cleanup();
                // Check whether the response callback has run.
                if (!finished) {
                    // It hasn't, something went wrong with the request. Return an error via
                    // the Observable error path. All JSONP errors have status 0.
                    observer.error(new HttpErrorResponse({
                        url: url,
                        status: 0,
                        statusText: 'JSONP Error',
                        error: new Error(JSONP_ERR_NO_CALLBACK),
                    }));
                    return;
                }
                // Success. body either contains the response body or null if none was
                // returned.
                observer.next(new HttpResponse({
                    body: body,
                    status: 200,
                    statusText: 'OK', url: url,
                }));
                // Complete the stream, the response is over.
                observer.complete();
            }
390767
function (response, body) {
          var tokenResponse;
          try {
             tokenResponse = self._handlePollingResponse(body);
          } catch (e) {
             self._log.error('Error validating get token response', e, true);
             callback(null, e);
             return;
          }
        
          callback(null, tokenResponse);
       }
349980
function notFoundError(response, error) {
  var content = errorContentExt(ErrorType.invalidRequest, error);
  send(response, content, StatusCode.notFound);
}
1184938
function (error, response) {
            // Destroy the client - frees up resources so that the application
            // stops running
            client.destroy()
            // Display the contents of an error, if one occurred
            if (error) {
              console.log('Request error: ' + error.message)
              // The 'code' property, if set, typically has a string
              // representation of the error code.
              if (error.code) {
                console.log('Request error code: ' + error.code)
              // If no string representation is available for the error code
              // but the error is a DXL 'RequestError', a numeric error
              // code should be available in the
              // 'dxlErrorResponse.errorCode' property.
              } else if (error.dxlErrorResponse) {
                console.log('Request error code: ' +
                  error.dxlErrorResponse.errorCode)
              }
            // No error occurred, so extract information from the response. The
            // toString() call converts the payload from a binary Buffer into a
            // string, decoded using UTF-8 character encoding.
            } else {
              console.log('Client received response payload: ' +
                response.payload.toString())
            }
          }
342551
def _check_error_response(response, query):
        
        if "error" in response:
            http_error = ["HTTP request timed out.", "Pool queue is full"]
            geo_error = [
                "Page coordinates unknown.",
                "One of the parameters gscoord, gspage, gsbbox is required",
                "Invalid coordinate provided",
            ]
            err = response["error"]["info"]
            if err in http_error:
                raise HTTPTimeoutError(query)
            elif err in geo_error:
                raise MediaWikiGeoCoordError(err)
            else:
                raise MediaWikiException(err)
1274895
function invalidResponseError(result, host) {
  const message = !!result && !!result.error && !!result.error.message ? `[ethjs-provider-http] ${result.error.message}` : `[ethjs-provider-http] Invalid JSON RPC response from host provider ${host}: ${JSON.stringify(result, null, 2)}`;
  return new Error(message);
}
140549
function onServerPreResponseHandler (ctx, err, value) {
  // check if an error was already wrapped
  if (ctx._response.error) {
    ctx.emit('serverResponseError', ctx._response.error);
    ctx.log.error(ctx._response.error);
  } else if (err) { // check for an extension error
    if (err instanceof SuperError) {
      ctx._response.error = err.rootCause || err.cause || err;
    } else {
      ctx._response.error = err;
    }
    const internalError = new Errors.MostlyError(
        Constants.EXTENSION_ERROR, ctx.errorDetails).causedBy(err);
    ctx.log.error(internalError);

    ctx.emit('serverResponseError', ctx._response.error);
  }

  // reply value from extension
  if (value) {
    ctx._response.payload = value;
  }

  // create message payload
  ctx._buildMessage();

  // indicates that an error occurs and that the program should exit
  if (ctx._shouldCrash) {
    // only when we have an inbox othwerwise exit the service immediately
    if (ctx._replyTo) {
      // send error back to callee
      return ctx._transport.send(ctx._replyTo, ctx._message, () => {
        // let it crash
        if (ctx._config.crashOnFatal) {
          ctx.fatal();
        }
      });
    } else if (ctx._config.crashOnFatal) {
      return ctx.fatal();
    }
  }

  // reply only when we have an inbox
  if (ctx._replyTo) {
    return ctx._transport.send(ctx._replyTo, ctx._message);
  }
}
1010907
function serverError(err, res) {
  // error is required to be logged
  log('error', err.message, { stack: err.stack });

  const message = err.message || 'Server Error', // completely hide these messages from outside
    code = 500;

  sendDefaultResponseForCode(code, message, res);
}
1103202
function catchClientError(req, res, next) {
  const { end } = res;

  res.end = function() {
    // console.log(`Catch client response : ${req.url} ${res.statusCode}`);
    const errorRoute = Route
      .routes('err')
      .filter((obj) => {
        return obj.extra.status === res.statusCode && obj.route !== req.url;
      });

    if(errorRoute.length > 0 && !isRedirect) {
      return redirect(errorRoute[0], req, res, next);
    }

    isRedirect = false;
    end.apply(res, arguments);
  };

  next();
}
926571
function expressResponseError(response, error, message) {
  let errorMessage = "there was an error in the request";
  if(message)
    errorMessage = message
  response.json({ success: false, error: errorMessage });
  console.error(error);
}
1229634
function(err) {
        if (err) this._onError(err);
        if (this._continueErrors || !err) {
            var args = [].slice.call(arguments);
            if (this._callbacks.length > 0) {
                this._isQueueRunning = true;
                var cb = this._callbacks.shift();
                cb = cb.bind(this);
                args = args.slice(1);
                args.push(this.next);
                cb.apply(this, args);

            } else {
                this._isQueueRunning = false;
                this.start = (function() {
                    this.start = null;
                    this.next.apply(this, args);
                }).bind(this);

            }
        }
        return this;
    }
507610
private void errorIf(ClientResponse response,
            ClientResponse.Status[] status, boolean bool)
            throws ClientException {
        ClientResponse.Status clientResponseStatus
                = response.getClientResponseStatus();
        if (bool) {
            if (contains(status, clientResponseStatus)) {
                String message = response.getEntity(String.class);
                throw new ClientException(clientResponseStatus, message);
            }
        } else if (!contains(status, clientResponseStatus)) {
            String message = response.getEntity(String.class);
            throw new ClientException(clientResponseStatus, message);
        }
    }
1174539
function onError(err) {
        if (callback) {
            callback(err);
        }
        else if (that.emitErrs) {
            that.emit('error', err);
        }
    }
668027
function(err) {
            Dialogs.alert("Error:", err.message || err);
            console.error(err.stack || err.message || err);
            return Q.reject(err);
        }