Skip to content

Commit

Permalink
feat: improve error overlay when hint exists
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Jul 19, 2022
1 parent 1a3746c commit 1a2a883
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/astro/src/core/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ export function getViteErrorPayload(err: ErrorWithMetadata): ErrorPayload {
if (!plugin && err.hint) {
plugin = 'astro';
}
const message = `${err.message}\n\n${err.hint ?? ''}`;
return {
type: 'error',
err: {
...err,
plugin,
message: err.hint ?? err.message,
message: message.trim(),
stack: err.stack,
}
}
Expand Down

0 comments on commit 1a2a883

Please sign in to comment.