Iskra API Reference
    Preparing search index...

    Class QueryError

    A statement or transaction failed. context.errorCode holds the code of the database or the driver: 'ORA-00001' (a unique constraint), or node-oracledb's own, such as 'NJS-040' (no free connection within pool.queueTimeout) or 'NJS-123' (callTimeout exceeded). For a database error context.errorNum holds its number (1 for ORA-00001) and context.oracleCode its code. The original error is cause.

    Its code tells an HTTP handler (web-kit's response contract) how to answer: TIMEOUT (504) for NJS-123 and a DeadlineError, SERVICE_UNAVAILABLE (503) for NJS-040, CONFLICT (409) for ORA-00001, QUERY_ERROR (500) for the rest. The message stays server-side.

    Hierarchy (View Summary)

    Index
    code: ErrorCode
    context: Record<string, unknown>
    • get applicationError(): { message: string; number: number } | undefined

      A PL/SQL RAISE_APPLICATION_ERROR (ORA-20000 to ORA-20999): its number and message, without the ORA-20xxx: prefix and the ORA-06512 stack lines. Its code is CONFLICT (409), and the message is for the client.

      Returns { message: string; number: number } | undefined

    • get errorCode(): string | undefined

      The database's or the driver's code: 'ORA-00001', 'NJS-040', 'NJS-123'…

      Returns string | undefined

    • get errorNum(): number | undefined

      The ORA error number of the failure, if the database reported one.

      Returns number | undefined

    • get expose(): boolean

      Whether web-kit shows the message to the client: a PL/SQL application error's.

      Returns boolean

    • get timedOut(): boolean

      The statement ran out of time: node-oracledb's callTimeout (NJS-123) or the driver's deadline.

      Returns boolean

    • Returns {
          cause?: string;
          code: ErrorCode;
          context: Record<string, unknown>;
          message: string;
          name: string;
      }