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: do not print generic error message for expected errors #110

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

km1chno
Copy link
Collaborator

@km1chno km1chno commented Sep 19, 2024

Resolves #21

Before

Zrzut ekranu 2024-09-19 o 12 16 03

After

Zrzut ekranu 2024-09-19 o 12 15 48

@km1chno km1chno self-assigned this Sep 19, 2024
maciekstosio
maciekstosio previously approved these changes Sep 19, 2024
Copy link
Collaborator

@maciekstosio maciekstosio left a comment

Choose a reason for hiding this comment

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

One nit pick and we are good to go!

@@ -123,7 +123,7 @@ module.exports = (toolbox: CycliToolbox) => {
}).prompt()

if (isCancel(confirmed)) {
throw Error('The script execution has been canceled by the user.')
throw CycliError('The script execution has been canceled by the user.')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should also have some predefined errors so we don't repeat this every time? Like const CycliErrorCanceled = new CycliError(...), wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It could be even just here at the top of file as it seems to be just in this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea, done in 8cc3ad7

@km1chno km1chno merged commit 46e637e into main Sep 19, 2024
4 checks passed
@km1chno km1chno deleted the @km1chno/fix-better-error-messages branch September 19, 2024 12:43
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.

Don't print generic error message for expected errors
2 participants