-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: standardised Snyk catalog errors handling
- Loading branch information
Showing
7 changed files
with
89 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,31 @@ | ||
export type JsonApiError = { | ||
enum Classification { | ||
UNEXPECTED = 'UNEXPECTED', | ||
ACTIONABLE = 'ACTIONABLE', | ||
UNSUPPORTED = 'UNSUPPORTED', | ||
} | ||
|
||
type JsonApiErrorSource = { pointer: string } | { parameter: string } | { header: string }; | ||
|
||
export type JsonApiErrorObject = { | ||
id?: string; | ||
links?: { | ||
about?: string; | ||
}; | ||
status: string; | ||
code: string; | ||
title: string; | ||
detail: string; | ||
source?: JsonApiErrorSource; | ||
meta: { | ||
[x: string]: any; | ||
|
||
// Allow consumers to probe if this specific type of JsonApi | ||
// response originates from an error catalog error. | ||
isErrorCatalogError: boolean; | ||
|
||
classification?: Classification; | ||
|
||
// Logs related to the error that was thrown | ||
logs?: string[]; | ||
}; | ||
}; |
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
Oops, something went wrong.