Skip to content

Printing the actual error message when Model.set fails#133

Merged
matmar10 merged 1 commit intodomasx2:masterfrom
sezanzeb:master
Apr 5, 2022
Merged

Printing the actual error message when Model.set fails#133
matmar10 merged 1 commit intodomasx2:masterfrom
sezanzeb:master

Conversation

@sezanzeb
Copy link
Copy Markdown
Contributor

@sezanzeb sezanzeb commented Jan 17, 2022

If the function provided via set throws an error, it will hide the error message, which makes it hard to debug.

  column: {
    ...
    set: () => { throw new Error('foo bar') }
  },

before:

Error: Error using Model.set method for model Product property ... (possibly due to the use of instance methods). You should use option ignoreSet: true.
    at node_modules/sequelize-fixtures/lib/loader.js:105:29

after:

Error: Error using Model.set method for model Product property ... (possibly due to the use of instance methods). You should use option ignoreSet: true.
Error: foo bar
    at node_modules/sequelize-fixtures/lib/loader.js:105:29

Copy link
Copy Markdown
Collaborator

@matmar10 matmar10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution.

@matmar10 matmar10 merged commit 657dc8e into domasx2:master Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants