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

Handle unexpected errors from the runChromaticBuild method (cli misconfigured, missing build commmand, etc) #132

Conversation

weeksling
Copy link
Contributor

This is a quick fix to handle unexpected errors from the cli run method. The UI portion of the failure is handled by the onBuildProgressOrError, but the try-catch is necessary to prevent the server from crashing. Added a console.error to log the error that was caught, however this error is not as useful as the actual CLI logs. I felt it would be useful to keep in case an error occurs that the cli doesn't properly log for.

…led by the onCompleteOrError method reports failure, but try-catch needed to handle gracefully
@linear
Copy link

linear bot commented Oct 13, 2023

AP-3753 Storybook Server Crashes if there was an error running the CLI

When chromatic is misconfigured and a user attempts to run a build, when it fails it crashes the storybook-server. It properly displays a toast notification in the storybook ui, and it also logs the error from the cli, but the thrown error isn't caught, which causes the crash.

A user reported this issue in the ext-visual-tests-addon channel.
Misconfiguration of the add-on, i.e. buildScriptName not provided, will cause the Storybook server to stop. Could we instead get an error message in the "Visual tests" panel in Storybook UI?

https://chromaticqa.slack.com/archives/C05LRPYU649/p1697204966240229

src/index.ts Show resolved Hide resolved
@weeksling weeksling merged commit 91e37df into main Oct 13, 2023
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