Skip to content

refactor: show error once#167

Merged
pi0 merged 1 commit intounjs:mainfrom
IWANABETHATGUY:fix/duplicated-errors
Mar 8, 2025
Merged

refactor: show error once#167
pi0 merged 1 commit intounjs:mainfrom
IWANABETHATGUY:fix/duplicated-errors

Conversation

@IWANABETHATGUY
Copy link
Copy Markdown
Contributor

@IWANABETHATGUY IWANABETHATGUY commented Aug 3, 2024

} else {
consola.error(error, "\n");
}
consola.error(error.message);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are only two conditions, is cli error or not, so we can make sure there must be something printed already, if the erroris undefined theerror.message` should be empty or raise a runtime error. So just remove it to avoid printing duplicated error.

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review August 3, 2024 08:17
@pi0 pi0 changed the title fix: don't show unhandled error twice refactor: show error once Mar 8, 2025
Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks for PR. The idea was intentional to show brief message only in the end. But I guess is better to show once

@pi0 pi0 merged commit 000a54e into unjs:main Mar 8, 2025
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.

Citty will emit unhandled errors twice in run function

2 participants