Repository navigation
Conversation
Avoid `(node:120) Warning: a promise was rejected with a non-error: [object String]` by rejecting with an error, like your other Promise.reject calls.
SimonSchick
approved these changes
Mar 6, 2019
SimonSchick
left a comment
Contributor
There was a problem hiding this comment.
Yup, I don't think this needs a functional test.
But please ensure https://eslint.org/docs/rules/prefer-promise-reject-errors is enabled!
| // it will not throw an error like built-ins do (e.g. DESCRIBE on MySql). | ||
| if (_.isEmpty(data)) { | ||
| return Promise.reject(`No description found for "${tableName}" table. Check the table name and schema; remember, they _are_ case sensitive.`); | ||
| return Promise.reject(new Error(`No description found for "${tableName}" table. Check the table name and schema; remember, they _are_ case sensitive.`)); |
Contributor
There was a problem hiding this comment.
Nit: you can make this a throw since this is a promise context.
Contributor
There was a problem hiding this comment.
Yes, throw will be clean
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
Avoid
(node:120) Warning: a promise was rejected with a non-error: [object String]by rejecting with an error, like your other Promise.reject calls.