import { EErrorCodes, EErrorTypeDescriptions, IErrorObject, IUserTranslation, TErrorCallback, TLoggerCallBack } from "./interfaces.js"; import { ValidationErrorItem } from "express-openapi-validator/dist/framework/types.js"; import { ESupportedLanguages, ETranslationNamespaces } from "../interfaces/index.js"; import { TErrorLine } from "../utils/index.js"; import { HTTPError } from "got"; import mongoose from "mongoose"; declare abstract class CustomError extends Error { private readonly _typeDescriptions; private _status; private readonly _origin; protected constructor(message: string, _typeDescriptions: EErrorTypeDescriptions, _status: EErrorCodes, _origin: TErrorLine); get origin(): string; get status(): number; set status(status: EErrorCodes); get type(): EErrorTypeDescriptions; abstract callGetErrors(): IErrorObject; } export declare class GeneralError extends CustomError { private readonly _message; private _translation; private readonly _translationKey; private readonly _userLanguage; private readonly _namespace; private _route; constructor(_message: string, typeDescription: EErrorTypeDescriptions, status: number, origin: TErrorLine, userTranslation?: IUserTranslation, route?: string); get translationKey(): string | null; get language(): ESupportedLanguages | null; get translation(): string | null; set status(status: EErrorCodes); get route(): string | null; set route(route: string); get status(): EErrorCodes; get namespace(): ETranslationNamespaces | null; callSetTranslation(translation: string): void; callGetErrors(): IErrorObject; } export declare class OpenApiValidationError extends CustomError { private readonly _errors; private _translation; private readonly _translationKey; private readonly _userLanguage; private readonly _namespace; private readonly _route; constructor(_errors: ValidationErrorItem[], origin: TErrorLine, userTranslation?: IUserTranslation, route?: string); get message(): string; callSetTranslation(translation: string): void; get translationKey(): string | null; get namespace(): ETranslationNamespaces | null; get language(): ESupportedLanguages | null; get translation(): string | null; callGetErrors(): IErrorObject; } export declare function raiseRuntimeError(status: EErrorCodes, origin: TErrorLine, logMessage: string, optional: { logCallBack?: TLoggerCallBack; userTranslation?: IUserTranslation; rawError?: unknown; }, route: string, tenant?: string | null): never; export declare function logRuntimeError(status: EErrorCodes, origin: TErrorLine, logMessage: string, optional: { logCallBack?: TLoggerCallBack; userTranslation?: IUserTranslation; rawError?: unknown; }, route: string, tenant: string | null): CustomError; export declare function handle500Error(tenant: string, origin: TErrorLine, route: string, logCallBack?: TLoggerCallBack): TErrorCallback; export declare function handle500ErrorWithTranslation(lng: ESupportedLanguages, tenant: string, origin: TErrorLine, route: string, logCallBack?: TLoggerCallBack): TErrorCallback; export declare function isMongoBulkWriteError(error: Error | mongoose.mongo.MongoBulkWriteError): error is mongoose.mongo.MongoBulkWriteError; export declare function isMongoDuplicateKeyError(error: Error | mongoose.mongo.MongoServerError): error is mongoose.mongo.MongoServerError; export declare function convertGotErrorToGeneralError(error: HTTPError, origin: TErrorLine, route: string, optional: { userTranslation?: { language: ESupportedLanguages; namespace: ETranslationNamespaces; errorKey?: string; }; logCallBack?: TLoggerCallBack; }): never; export {}; //# sourceMappingURL=error.d.ts.map