* Updated abort behavior - Support for aborting a request with the promise api - Aborting a request will cause a RequestAbortedError - Normalized Connection class errors, now every error returned is wrapped by the client errors constructors * Updated test * Updated docs * Updated code generation script * Renamed test * Code coverage * Avoid calling twice transport.request
68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
// Licensed to Elasticsearch B.V under one or more agreements.
|
|
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
// See the LICENSE file in the project root for more information
|
|
|
|
import { ApiResponse, ResponseBody } from './Transport'
|
|
|
|
export declare class ElasticsearchClientError extends Error {
|
|
name: string;
|
|
message: string;
|
|
}
|
|
|
|
export declare class TimeoutError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
meta: ApiResponse;
|
|
constructor(message: string, meta: ApiResponse);
|
|
}
|
|
|
|
export declare class ConnectionError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
meta: ApiResponse;
|
|
constructor(message: string, meta: ApiResponse);
|
|
}
|
|
|
|
export declare class NoLivingConnectionsError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
meta: ApiResponse;
|
|
constructor(message: string, meta: ApiResponse);
|
|
}
|
|
|
|
export declare class SerializationError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
data: any;
|
|
constructor(message: string, data: any);
|
|
}
|
|
|
|
export declare class DeserializationError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
data: string;
|
|
constructor(message: string, data: string);
|
|
}
|
|
|
|
export declare class ConfigurationError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
constructor(message: string);
|
|
}
|
|
|
|
export declare class ResponseError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
meta: ApiResponse;
|
|
body: ResponseBody;
|
|
statusCode: number;
|
|
headers: Record<string, any>;
|
|
constructor(meta: ApiResponse);
|
|
}
|
|
|
|
export declare class RequestAbortedError extends ElasticsearchClientError {
|
|
name: string;
|
|
message: string;
|
|
meta: ApiResponse;
|
|
constructor(message: string, meta: ApiResponse);
|
|
} |