forked from withastro/astro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor error handling (withastro#5206)
* Refactor error handling * Fix import path in test * Revert "Fix import path in test" This reverts commit 5ca34f3. * Fix import path in test * Fix AggregateErrors actually not being.. an aggregration of errors * Fix missing info in Vite enhanced error * Conserve original error name if we have one * Workaround compiler issue * GitHub action please * Update E2E test * Wrap ssrFixStacktrace in try/catch * Refactor Vite/Node methods out of the general index.ts * Fix missing import * Add changeset
- Loading branch information
1 parent
3c1af36
commit d64d5b9
Showing
26 changed files
with
744 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Improve error messages related to CSS and compiler errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export enum AstroErrorCodes { | ||
// 1xxx are reserved for compiler errors | ||
StaticRedirectNotAllowed = 2005, | ||
UnavailableInSSR = 2006, | ||
// Runtime errors | ||
GenericRuntimeError = 3000, | ||
// PostCSS errors | ||
CssSyntaxError = 4000, | ||
CssUnknownError = 4001, | ||
// Vite SSR errors | ||
FailedToLoadModuleSSR = 5000, | ||
// Config Errors | ||
ConfigError = 6000, | ||
|
||
// Markdown Errors | ||
GenericMarkdownError = 7000, | ||
MarkdownFrontmatterParseError = 7001, | ||
|
||
// General catch-alls for cases where we have zero information | ||
UnknownCompilerError = 9000, | ||
UnknownCompilerCSSError = 9001, | ||
UnknownViteSSRError = 9002, | ||
UnknownError = 9999, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { collectErrorMetadata } from './utils.js'; | ||
export { createCustomViteLogger, enhanceViteSSRError, getViteErrorPayload } from './vite.js'; |
Oops, something went wrong.