Skip to content

Inconsistent error codes returned on duplicate key error #7637

Closed

Description

@simon-p-r

What you are doing?

Writing test cases for a module that is using sequelize. I have discovered the return value from a duplicate key error is different between postgres and mssql dialects. Error is of type SequelizeUniqueConstraintError for postgres however error returned by mssql is of type SequelizeDatabaseError.

What do you expect to happen?

Consistent error types between dialects

Dialect: postgres / mssql
Database Postgres 9.6 / SQL Server 2008 R2 & SQL Server 2016
Sequelize 3.30.4

Activity

  1. added
    type: bug
    breaking change
    on May 17, 2017
  2. stale commented on Jul 16, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂

  3. added this to the v5 milestone on May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changetype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions