How to use the elasticsearch.errors.NoConnections function in elasticsearch

To help you get started, we’ve selected a few elasticsearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / src / plugins / kibana / server / lib / __tests__ / handle_es_error.js View on Github external
it('should return a boom 503 server timeout error for ES connection errors', function () {
    expect(handleESError(new esErrors.ConnectionFault()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.ServiceUnavailable()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.NoConnections()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.RequestTimeout()).output.statusCode).to.be(503);
  });
github elastic / kibana / src / legacy / core_plugins / elasticsearch / lib / __tests__ / handle_es_error.js View on Github external
it('should return a boom 503 server timeout error for ES connection errors', function () {
    expect(handleESError(new esErrors.ConnectionFault()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.ServiceUnavailable()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.NoConnections()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.RequestTimeout()).output.statusCode).to.be(503);
  });
github elastic / kibana / src / core_plugins / kibana / server / lib / __tests__ / handle_es_error.js View on Github external
it('should return a boom 503 server timeout error for ES connection errors', function () {
    expect(handleESError(new esErrors.ConnectionFault()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.ServiceUnavailable()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.NoConnections()).output.statusCode).to.be(503);
    expect(handleESError(new esErrors.RequestTimeout()).output.statusCode).to.be(503);
  });
github elastic / kibana / x-pack / legacy / plugins / monitoring / server / lib / errors / __tests__ / known_errors.js View on Github external
it('handles NoConnections', () => {
    const err = new errors.NoConnections();
    expect(isKnownError(err)).to.be(true);

    const wrappedErr = handleKnownError(err);
    expect(wrappedErr.message).to.be(
      'No Living connections: ' +
      'Check the Elasticsearch Monitoring cluster network connection and refer to the Kibana logs for more information.'
    );
    expect(wrappedErr.isBoom).to.be(true);
    expect(wrappedErr.isServer).to.be(true);
    expect(wrappedErr.data).to.be(null);
    expect(wrappedErr.output).to.eql({
      statusCode: 503,
      payload: {
        statusCode: 503,
        error: 'Service Unavailable',
        message: (
github elastic / kibana / src / server / saved_objects / client / lib / __tests__ / decorate_es_error.js View on Github external
it('makes es.NoConnections a SavedObjectsClient/EsUnavailable error', () => {
    const error = new esErrors.NoConnections();
    expect(isEsUnavailableError(error)).to.be(false);
    expect(decorateEsError(error)).to.be(error);
    expect(isEsUnavailableError(error)).to.be(true);
  });