Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(model): improve wrong alias error message #10041

Merged
merged 1 commit into from Oct 18, 2018
Merged

fix(model): improve wrong alias error message #10041

merged 1 commit into from Oct 18, 2018

Conversation

@papb
Copy link
Member

@papb papb commented Oct 17, 2018

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Closes #10040

@codecov
Copy link

@codecov codecov bot commented Oct 18, 2018

Codecov Report

Merging #10041 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10041      +/-   ##
==========================================
+ Coverage    96.3%    96.3%   +<.01%     
==========================================
  Files          63       63              
  Lines        9427     9428       +1     
==========================================
+ Hits         9079     9080       +1     
  Misses        348      348
Impacted Files Coverage Δ
lib/model.js 96.67% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6d2b47...e38d814. Read the comment docs.

@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Oct 18, 2018

Thanks for this PR, this has been discussed before #9079. My only concern is #9079 (comment)

@papb
Copy link
Member Author

@papb papb commented Oct 18, 2018

Oops, I should have searched a bit more, sorry.

To be honest, about your comment, I don't see a problem with a potentially huge list of things there:

  • One single alias is the most common situation, so this error message would be great in these cases;
  • Perhaps two or three aliases could indeed happen a few times, although never happened to me, but three aliases still isn't that much. And the more aliases that are defined, the less common it is.
  • And regardless of the above, at least personally, I don't mind huge error messages at all. What bugs me is short error messages that aren't useful. In fact, I am thankful that this error message is already very useful (compared to error messages from other JS libraries around), but it still could be better.

Usually this is an error that crashes the application, will be seen immediately by the developer, and I am positive that he/she wouldn't mind an error message that saves time, even if it is huge. Every time this happened to me, it took me a while to find out the correct alias...

@sushantdhiman sushantdhiman merged commit 08ab29c into sequelize:master Oct 18, 2018
4 checks passed
4 checks passed
codecov/patch 100% of diff hit (target 96.3%)
Details
codecov/project 96.3% (+<.01%) compared to f6d2b47
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Oct 18, 2018

Thanks @papb

Totally agree with you, error message should help developer as much they can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants