elasticsearch-exceptions

0.0.4 • Public • Published

Elasticsearch-exceptions

NPM version Build Status Coverage Status

Parse Elasticsearch exception responses and transform them into JavaScript Errors

var EsEx = require('elasticsearch-exceptions');

someRequestToElasticSearchOrUsingANodeJSClient(function(err, ok){
    if(EsEx.isAliasesMissingException(err)){
        // do something else
    }

    if(err){
        // do something
    }

    // etc...
});

Supported exceptions (Elasticsearch v1.4.0)

[
  'AggregationExecutionException',
  'AggregationInitializationException',
  'AliasesMissingException',
  'AlreadyExpiredException',
  'BlobStoreException',
  'CircuitBreakingException',
  'ClusterBlockException',
  'DelayRecoveryException',
  'DiscoveryException',
  'ElasticsearchException.WithRestHeaders',
  'ElasticsearchGenerationException',
  'ElasticsearchIllegalArgumentException',
  'ElasticsearchIllegalStateException',
  'ElasticsearchNullPointerException',
  'ElasticsearchParseException',
  'ElasticsearchTimeoutException',
  'EsRejectedExecutionException',
  'ExpressionScriptCompilationException',
  'ExpressionScriptExecutionException',
  'FacetPhaseExecutionException',
  'FailedNodeException',
  'FailedToResolveConfigException',
  'GatewayException',
  'GroovyScriptCompilationException',
  'GroovyScriptExecutionException',
  'HttpException',
  'IgnoreRecoveryException',
  'IndexException',
  'IndexShardAlreadyExistsException',
  'IndexTemplateAlreadyExistsException',
  'IndexTemplateMissingException',
  'IndexMissingException',
  'IndexWarmerMissingException',
  'InvalidIndexTemplateException',
  'Lucene.EarlyTerminationException',
  'MapperException',
  'MasterNotDiscoveredException',
  'NodeClosedException',
  'NoNodeAvailableException',
  'PercolateException',
  'PrimaryMissingActionException',
  'ProcessClusterEventTimeoutException',
  'RecoveryFailedException',
  'RepositoryException',
  'RiverException',
  'RoutingException',
  'RoutingMissingException',
  'ScriptException',
  'SearchContextMissingException',
  'SearchException',
  'SearchPhaseExecutionException',
  'SearchSourceBuilderException',
  'SettingsException',
  'SnapshotException',
  'SuggestBuilderException',
  'TimestampParsingException',
  'TranslogCorruptedException',
  'TransportException',
  'UnavailableShardsException',
  'UncategorizedExecutionException'
]

Todo

  • transform elasticsearch client errors to elasticsearch-exceptions
  • parse exception body

Readme

Keywords

none

Package Sidebar

Install

npm i elasticsearch-exceptions

Weekly Downloads

25

Version

0.0.4

License

MIT

Last publish

Collaborators

  • fgribreau
  • juliendangers