File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change 1
- import type { PostgrestError as IPostgrestError } from './types'
2
-
3
- export default class PostgrestError extends Error implements IPostgrestError {
1
+ /**
2
+ * Error format
3
+ *
4
+ * {@link https://postgrest.org/en/stable/api.html?highlight=options#errors-and-http-status-codes}
5
+ */
6
+ export default class PostgrestError extends Error {
4
7
details : string
5
8
hint : string
6
9
code : string
7
10
8
- constructor ( context : IPostgrestError ) {
11
+ constructor ( context : { message : string ; details : string ; hint : string ; code : string } ) {
9
12
super ( context . message )
10
13
this . name = 'PostgrestError'
11
14
this . details = context . details
Original file line number Diff line number Diff line change 1
- export type Fetch = typeof fetch
1
+ import PostgrestError from './PostgrestError'
2
2
3
- /**
4
- * Error format
5
- *
6
- * {@link https://postgrest.org/en/stable/api.html?highlight=options#errors-and-http-status-codes}
7
- */
8
- export type PostgrestError = {
9
- message : string
10
- details : string
11
- hint : string
12
- code : string
13
- }
3
+ export type Fetch = typeof fetch
14
4
15
5
/**
16
6
* Response format
You can’t perform that action at this time.
0 commit comments