-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure thrown errors have a stack trace (#502)
* Ensure thrown errors have a stack trace * chore: stricter typing * chore: update snapshot --------- Co-authored-by: Bobbie Soedirgo <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { PostgrestError as IPostgrestError } from './types' | ||
|
||
export default class PostgrestError extends Error implements IPostgrestError { | ||
details: string | ||
hint: string | ||
code: string | ||
|
||
constructor(context: IPostgrestError) { | ||
super(context.message) | ||
this.name = 'PostgrestError' | ||
this.details = context.details | ||
this.hint = context.hint | ||
this.code = context.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