/** * A failure as the driver's own line carries it under `cause`: the error's name, the vendor's * codes and, as `message`, the driver's sentence — the field a reader of any driver's line parses. */ export type FailureCause = { name?: string; code?: string; errno?: number; sqlState?: string; message: string; /** The server's own message — behind the dev-only values switch, never otherwise. */ sqlMessage?: string; }; /** * The ONE owner of how a failure of the database reads on a LOG LINE: the vendor's codes and a * sentence of the driver's own — never the vendor's text. * * What the driver THROWS is the vendor's error itself, untouched, and it is not safe to print: * the query layer rewrites its `message` to the SQL with every binding INTERPOLATED, the client * library carries the same text as `sql`, and the server's own message (`sqlMessage`) quotes the * value it refused (`Duplicate entry '' for key 'PRIMARY'`). The driver's own line never * carried the first two; a CALLER's line about the error it caught carried all three. So every * failure that leaves the driver is marked with the logger (`mark`), which never touches the * error; from then on any line about it, the driver's or a caller's, carries the codes and the * sentence in place of the error's own text. * * The vendor's text rides a line only behind the dev-only values switch (KnexLogValues): with * both gates open a marked error prints as it is, and `causeOf` adds the server's message. * Asked at each line, like the switch itself. */ export declare class KnexFailureLine { private static readonly UNNAMED; private static readonly UNREACHABLE; private static readonly SENTENCES; /** * The failures the query layer raises itself, which carry no vendor code — by the error's name. * Its timeout is one error for the statement's operation deadline and for the wait for a free * connection; either way it carries the statement's bindings, so it is marked like any other. */ private static readonly SENTENCES_BY_NAME; /** * Marks `error` — whatever the client library or the query layer rejected with — as never * printing its own text, and answers the same error. `what` is the driver's words for what * failed. An error already marked keeps its line. */ static mark(error: T, what: string): T; /** * The failure as the driver's own line carries it under `cause` — never the query layer's * rewritten `message` or `sql`, and the server's own message only behind the values switch. * Total: a fact that cannot be read is left out. */ static causeOf(error: unknown): FailureCause; private static lineOf; private static sentenceOf; /** One fact of a thrown value, or nothing when it cannot be read (nothing thrown, a scalar, a throwing accessor). */ private static vendorFact; } //# sourceMappingURL=KnexFailureLine.d.ts.map