How to use the elasticsearch.errors.ServiceUnavailable 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 / server / saved_objects / client / lib / __tests__ / decorate_es_error.js View on Github external
it('makes es.ServiceUnavailable a SavedObjectsClient/EsUnavailable error', () => {
    const error = new esErrors.ServiceUnavailable();
    expect(isEsUnavailableError(error)).to.be(false);
    expect(decorateEsError(error)).to.be(error);
    expect(isEsUnavailableError(error)).to.be(true);
  });
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);
  });