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(mssql): return aggregated error instead of last error #16188

Merged
merged 9 commits into from
Jul 19, 2023

Conversation

lohart13
Copy link
Contributor

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description Of Change

Return aggregated for MSSQL when the error object as an error.errors length greater than 0.

Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

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

Looks good in general. Would it be possible to add a test that checks for the other errors as well to make sure it's not giving back random messages/errors?

packages/core/test/integration/query-interface.test.js Outdated Show resolved Hide resolved
packages/core/src/dialects/mssql/query.js Outdated Show resolved Hide resolved
@lohart13
Copy link
Contributor Author

@WikiRik I've added some more tests now.
LMK if you have any others error tests in mind.

All other errors with either return an AggregateError or DatabaseError

@lohart13 lohart13 force-pushed the fix-mssql-errors branch 3 times, most recently from 3c02430 to df2670b Compare July 2, 2023 08:58
Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

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

There's a few instances where you can better use backticks for strings so you have less instances of escaping single quotes, but I want to look for a eslint rule to fix that so it's fine here

@ephys might have some suggestions for using decorators in the tests, but we haven't made a clear policy on that yet (or given some guidelines in CONTRIBUTING docs)

@WikiRik WikiRik requested a review from ephys July 6, 2023 19:42
@WikiRik
Copy link
Member

WikiRik commented Jul 19, 2023

I'll merge this anyway, but @ephys feel free to still comment on usages of decorators in tests later

@WikiRik WikiRik added this pull request to the merge queue Jul 19, 2023
Merged via the queue into sequelize:main with commit dea29f7 Jul 19, 2023
47 checks passed
@lohart13 lohart13 deleted the fix-mssql-errors branch July 19, 2023 08:49
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.

None yet

2 participants