-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(developer-server): catch more error types and show more context i…
…n own errors
- Loading branch information
Showing
9 changed files
with
67 additions
and
57 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,22 +1,22 @@ | ||
export class DeveloperServerError extends Error { | ||
public readonly path: string; | ||
public readonly params: Record<string, string | Blob> | undefined; | ||
public readonly output: string; | ||
public readonly payload?: RequestInit; | ||
public readonly response: Response; | ||
|
||
constructor(options: { | ||
path: string; | ||
params?: Record<string, string | Blob> | undefined; | ||
output: string; | ||
message?: string; | ||
path: string; | ||
payload?: RequestInit; | ||
response: Response; | ||
}) { | ||
super( | ||
options.message || | ||
`Failed to parse result of ${options.path} command: ${options.output}` | ||
options.message ?? | ||
`Request to "${options.path}" failed: ${options.response.status} ${options.response.statusText}` | ||
); | ||
|
||
this.name = 'DeveloperServerError'; | ||
this.path = options.path; | ||
this.params = options.params; | ||
this.output = options.output; | ||
this.payload = options.payload!; | ||
this.response = options.response; | ||
} | ||
} |
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 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