开发者社区> 镜像站> NPM> elasticsearch-exceptions
elasticsearch-exceptions
Parse Elasticsearch exception responses and transform them into JavaScript Errors
Last updated 6 years ago by juliendangers .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install elasticsearch-exceptions 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.4                                ...           latest (6 years ago)

3 Versions

  • 0.0.4                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (6)