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

TypeScript type definition file for SqlError constructor does not match actual constructor

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 3.3.2
    • typescript
    • None

    Description

      from https://github.com/mariadb-corporation/mariadb-connector-nodejs/issues/292

      Current Situation:
      The TypeScript type definition file defines a constructor with seven (7) arguments while the actual implementation has nine (9) arguments.

      Consequence: When trying to instantiate using the mariadb.SqlError class

      the sql and cause arguments are not visible to typescript
      if the constructor is invoked as seen by typescript, the arguments are assigned to the wrong fields internally
      one cannot set the cause argument at all
      TypeScript constructor signature:
      interface SqlErrorConstructor extends ErrorConstructor { new ( msg: string, fatal?: boolean, info?:

      { threadId?: number }

      , sqlState?: string | null, errno?: number, additionalStack?: string, addHeader?: boolean ): SqlError; readonly prototype: SqlError; }

      Actual Implementation: constructor(msg, sql, fatal, info, sqlState, errno, additionalStack, addHeader = undefined, cause)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.