@grouparoo/core
Version:
The Grouparoo Core
35 lines (34 loc) • 1.17 kB
TypeScript
import { WhereOptions } from "sequelize/types";
export declare namespace Errors {
const ERROR_LEVELS: readonly ["error", "info"];
type ErrorLevel = typeof ERROR_LEVELS[number];
class GrouparooError extends Error {
code: string | number;
sql?: string;
errors?: GrouparooError[];
fields?: string[];
type?: string;
serialize?: () => Record<string, string>;
}
class InfoError extends GrouparooError {
errorLevel: ErrorLevel;
constructor(message: string);
}
class AuthenticationError extends GrouparooError {
code: string;
constructor(message: string, code?: string);
}
class AuthorizationError extends GrouparooError {
code: string;
constructor(mode: string, topic: string, code?: string);
}
class UniqueError extends GrouparooError {
message: string;
model: string;
fields: string[];
whereOpts: WhereOptions;
code: string;
constructor(message: string, model: string, fields: string[], whereOpts: WhereOptions, code?: string);
serialize: () => Record<string, string>;
}
}