-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: update Promise.reject()
(s) across codebase to throw Error("message")
, instead of regular string
#5144
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Jim Ezesinachi <ezesinachijim@gmail.com>
Promise.reject()
(s) across codebase to throw Error("message")
, instead of regular string
Signed-off-by: Jim Ezesinachi <ezesinachijim@gmail.com>
I've made two of these changes so far. I will proceed adding more to this PR once I get a response from a maintainer that this change is still useful. Thank you! |
LGTM |
Quality Gate passedIssues Measures |
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
Hey @jimezesinachi! This looks good! Now that 10.9 is finally out the door it would be good to get these fixed. Thanks! |
Excellent! Do you want to merge in this one no, or should I add a couple other changes for the same rule? |
Let's just add the others here 👍 |
Excellent. Will work on this on the weekend 👍🏾 |
…hore/refactor-promise-rejections-to-throw-error
Updated the branch with master... good to merge now |
Note: from the wording of the rule (here: https://sonarcloud.io/organizations/jellyfin/rules?open=javascript%3AS6671&rule_key=javascript%3AS6671), my understanding is that it specifically applies any LMK what you think @thornbill @grafixeyehero @tomislav |
First, we Thanks for your contribution. To ensure consistency in our error handling, we should refactor the rejections that currently use strings or have no value to use Error objects instead. |
Understood. Just one more thing: for the ones that have no value, we can just pass an Empty error object (i.e |
You can give it a value based on what action was rejected |
Understood. On it now 👍🏾 |
Quality Gate passedIssues Measures |
Cloudflare Pages deployment
|
@jimezesinachi do you still plan to correct the other instances of this? Thanks! |
Affirmative... I'm still away from work, but this is on my agenda when I get back to work |
Back in today... working on this now |
Signed-off-by: Jim Ezesinachi <ezesinachijim@gmail.com>
…omise-rejections-to-throw-error
Signed-off-by: Jim Ezesinachi <ezesinachijim@gmail.com>
Quality Gate passedIssues Measures |
Updates are up and Actions check jobs completed |
@thornbill quick review on this? |
Changes
This change removes some code smell in the database. According to this rule (https://sonarcloud.io/organizations/jellyfin/rules?open=javascript%3AS6671&rule_key=javascript%3AS6671) on the project's SonarCloud, any
Promise.reject
call in the repository that currently returns a string, should be updated to return athrow Error('message')
, instead. This PR includes changes to different parts of the codebase with this issue.Issues