Skip to content

Commit

Permalink
Merge pull request #23689 from storybookjs/yann/fix-error-logging
Browse files Browse the repository at this point in the history
CLI: Fix error logging being swallowed from dev/build failures
  • Loading branch information
yannbf committed Aug 2, 2023
2 parents aad2749 + b6a486d commit 708a084
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/lib/core-server/src/withTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export async function withTelemetry<T>(
}

const { printError = logger.error } = options;
printError(error instanceof Error ? error.message : String(error));

// the type of error can be Error, string, or a Webpack/Vite Object, potentially other things. Therefore we cast to any
printError(error as any);
if (error instanceof Error) await sendTelemetryError(error, eventType, options);

throw error;
Expand Down

0 comments on commit 708a084

Please sign in to comment.