Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-165

Adding initial message error value on Error object.

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.4, 3.0.0-beta
    • Component/s: other
    • Labels:
      None

      Description

      Driver throw SqlError object defined like this :

      export interface SqlError extends Error {
        /**
         * Either a MySQL server error (e.g. 'ER_ACCESS_DENIED_ERROR'),
         * a node.js error (e.g. 'ECONNREFUSED') or an internal error
         * (e.g. 'PROTOCOL_CONNECTION_LOST').
         */
        code: string | null;
       
        /**
         * The error number for the error code
         */
        errno: number;
       
        /**
         * The sql state
         */
        sqlState?: string | null;
       
        /**
         * Boolean, indicating if this error is terminal to the connection object.
         */
        fatal: boolean;
      }
      

      extending Error with message value.
      Problem is that message as additional value added :
      example 'My error label' => message will be `(conn=5149, no: 1644, SQLState: 45000) My error label` + sql + stack

      This consist to adding 2 properties : initial message error and sql.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration