Skip to content

Commit cd476cc

Browse files
committed
error handling
1 parent e22f57a commit cd476cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

commands/storybook.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ async function storybook(serve, options) {
165165
// Call static render API
166166
await axios.post(new URL(constants[options.env].STATIC_RENDER_PATH, constants[options.env].BASE_URL).href, payload)
167167
.then(async function (response) {
168+
if (response.data && response.data.error) {
169+
console.log('[smartui] Error: ', response.data.error.message);
170+
process.exitCode = constants.ERROR_CATCHALL;
171+
return
172+
}
168173
console.log('[smartui] Build URL: ', response.data.data.buildURL);
169174
console.log('[smartui] Build in progress...');
170175
await shortPolling(response.data.data.buildId, 0, options);

0 commit comments

Comments
 (0)