Skip to content

Change exit code to 1 whenever an error was logged. #249

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AugustusKling
Copy link
Contributor

This is a preparation for #228

Adds a wrapper around the native console API to track if any errors were logged. If this is the case a non-zero exit code is set (via Clipanion as it sets exit codes after plugin commands are complete in https://github.com/arcanis/clipanion/blob/master/sources/advanced/Cli.ts#L551).

This PR does not include adding additional logs to address #228

@AugustusKling AugustusKling requested a review from a team as a code owner January 17, 2025 21:25
@jkowalleck
Copy link
Member

jkowalleck commented Jan 18, 2025

Why so complicated? Why not simply throw on error?

What is even the use case? Continuing after a warning - sure, but why should the code continue after an error was detected?
I'd rather throw an Error - it probably is not even needed to catch it, as yarn's plugin handler would handle it, right?

@jkowalleck jkowalleck changed the title Change exit code to 1 whenever an error was logged. Change exit code to 1 whenever an error was logged. Jan 18, 2025
@jkowalleck jkowalleck marked this pull request as draft March 27, 2025 11:09
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.

2 participants