UNPKG

3.9 kBTypeScriptView Raw
1import { HttpResponse } from "../Primitives/Http";
2export declare function printError(err: Error): string;
3export declare function throwError(errName: RavenErrorType): never;
4export declare function throwError(errName: RavenErrorType, message: string): never;
5export declare function throwError(errName: RavenErrorType, message: string, errCause?: Error): never;
6export declare function throwError(errName: RavenErrorType, message: string, errCause?: Error, info?: {
7 [key: string]: any;
8}): never;
9export declare function getError(errName: RavenErrorType, message: string): Error;
10export declare function getError(errName: string, message: string, errCause?: Error, info?: {
11 [key: string]: any;
12}): Error;
13export declare function getError(errName: string, message: string, errCause?: Error): Error;
14export declare type RavenErrorType = "RavenException" | "NotSupportedException" | "InvalidOperationException" | "InvalidArgumentException" | "ErrorResponseException" | "DocumentDoesNotExistsException" | "NonUniqueObjectException" | "ConcurrencyException" | "ArgumentNullException" | "ArgumentOutOfRangeException" | "DatabaseDoesNotExistException" | "ClientVersionMismatchException" | "AuthorizationException" | "IndexDoesNotExistException" | "DatabaseLoadTimeoutException" | "AuthenticationException" | "BadRequestException" | "BulkInsertAbortedException" | "BulkInsertProtocolViolationException" | "IndexCompilationException" | "TransformerCompilationException" | "DocumentConflictException" | "DocumentDoesNotExistException" | "DocumentParseException" | "IndexInvalidException" | "IndexOrTransformerAlreadyExistException" | "JavaScriptException" | "JavaScriptParseException" | "SubscriptionClosedException" | "SubscriptionDoesNotBelongToNodeException" | "SubscriptionChangeVectorUpdateConcurrencyException" | "SubscriptionDoesNotExistException" | "SubscriptionInvalidStateException" | "SubscriptionException" | "SubscriberErrorException" | "SubscriptionInUseException" | "TransformerDoesNotExistException" | "VersioningDisabledException" | "TopologyNodeDownException" | "AllTopologyNodesDownException" | "BadResponseException" | "ChangeProcessingException" | "CommandExecutionException" | "NoLeaderException" | "CompilationException" | "ConflictException" | "DatabaseConcurrentLoadTimeoutException" | "DatabaseDisabledException" | "DatabaseLoadFailureException" | "DatabaseNotFoundException" | "NotSupportedOsException" | "SecurityException" | "ServerLoadFailureException" | "UnsuccessfulRequestException" | "CriticalIndexingException" | "IndexAnalyzerException" | "IndexCorruptionException" | "IndexOpenException" | "IndexWriteException" | "IndexWriterCreationException" | "StorageException" | "StreamDisposedException" | "LowMemoryException" | "IncorrectDllException" | "DiskFullException" | "InvalidJournalFlushRequestException" | "QuotaException" | "VoronUnrecoverableErrorException" | "NonDurableFileSystemException" | "TimeoutException" | "AggregateException" | "OperationCancelledException" | "MappingError" | "UrlScrappingError" | "TestDriverTearDownError" | "FileNotFoundException" | "NotImplementedException" | "NodeIsPassiveException" | "ConfigurationException" | "CertificateNameMismatchException" | "BulkInsertStreamError" | "NotSupportedException" | "AttachmentDoesNotExistException" | "CounterOverflowException";
15export interface ExceptionSchema {
16 url: string;
17 type: string;
18 message: string;
19 error: string;
20}
21export interface ExceptionDispatcherArgs {
22 message: string;
23 url: string;
24 error?: string;
25 type?: string;
26}
27export declare class ExceptionDispatcher {
28 private static _jsonSerializer;
29 static get(schema: ExceptionDispatcherArgs, code: number): Error;
30 static throwException(response: HttpResponse, body: string): void | never;
31 private static _getConflictError;
32 private static _getType;
33}