import type { CommandErrorResponse } from '../types/commandType/CommandErrorResponse.js'; import type { ErrorResponsePayload } from '../types/ErrorResponsePayload.js'; import { StatusCode } from '../types/StatusCode.enum.js'; import type { TraceId } from '../types/TraceId.js'; import { HandledError } from './HandledError.impl.js'; /** * A unhandled error will be thrown if some error response is returned during invoking a service function * or when the invocation timed out. * This error is not handled by business logic and it is maybe unwanted to expose this error outside. * * Unhandled error are automatically converted into "500 Internal Server Error" to the outside world. */ export declare class UnhandledError extends Error { errorCode: StatusCode; data?: unknown; traceId?: TraceId | undefined; constructor(errorCode?: StatusCode, message?: string, data?: unknown, traceId?: TraceId | undefined); /** * Create a error object from EBMessage error message * @param message CommandErrorResponse * @returns UnhandledError */ static fromMessage(message: Readonly): UnhandledError; /** * Creates a UnhandledError from an input * * @param err the input * @param errorCode the error code * @param data optional data * @param traceId optional trace id * @returns UnhandledError */ static fromError(err: unknown, errorCode?: StatusCode, data?: unknown, traceId?: TraceId): UnhandledError; /** * Create a handled error from unhandled error * @returns HandledError */ intoHandledError(): HandledError; /** * Returns error response object * @returns ErrorResponsePayload */ getErrorResponse(): Readonly; /** * Returns stringified error response object * @returns ErrorResponse as string */ toString(): string; toJSON(): { status: StatusCode; message: string; traceId?: TraceId; data?: unknown; stack: string | undefined; name: string; }; } //# sourceMappingURL=UnhandledError.impl.d.ts.map