-
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.
fix(frontend): use CodedError everywhere
- Loading branch information
1 parent
599158b
commit eab432b
Showing
11 changed files
with
72 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes]; | ||
|
||
export const ErrorCodes = { | ||
UNCAUGHT_ERROR: 'UNC-0000', | ||
|
||
// auth error codes | ||
MISCONFIGURED_PROVIDER: 'AUTH-0001', | ||
|
||
// component error codes | ||
MISSING_LANG_PARAM: 'CMP-0001', | ||
|
||
// i18n error codes | ||
NO_LANGUAGE_FOUND: 'I18N-0001', | ||
|
||
// route error codes | ||
ROUTE_NOT_FOUND: 'RTE-0001', | ||
|
||
// validation error codes | ||
INVALID_NUMBER: 'VAL-0001', | ||
|
||
// dev-only error codes | ||
TEST_ERROR_CODE: 'DEV-0001', | ||
} as const; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { CodedError } from '~/errors/coded-error'; | ||
import { ErrorCodes } from '~/errors/error-codes'; | ||
|
||
/** | ||
* An error route that can be used to test error boundaries. | ||
*/ | ||
export default function Error() { | ||
throw new CodedError('ERR-0001'); | ||
throw new CodedError('This is a test error', ErrorCodes.TEST_ERROR_CODE); | ||
} |
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