File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -150,10 +150,10 @@ export default abstract class PostgrestBuilder<Result>
150
150
if ( ! this . shouldThrowOnError ) {
151
151
res = res . catch ( ( fetchError ) => ( {
152
152
error : {
153
- message : `FetchError: ${ fetchError . message } ` ,
154
- details : '' ,
153
+ message : `${ fetchError ?. name ?? ' FetchError' } : ${ fetchError ? .message } ` ,
154
+ details : ` ${ fetchError ?. stack ?? '' } ` ,
155
155
hint : '' ,
156
- code : fetchError . code || '' ,
156
+ code : ` ${ fetchError ? .code ?? '' } ` ,
157
157
} ,
158
158
data : null ,
159
159
count : null ,
Original file line number Diff line number Diff line change @@ -247,20 +247,23 @@ test('abort signal', async () => {
247
247
const ac = new AbortController ( ) as globalThis . AbortController
248
248
ac . abort ( )
249
249
const res = await postgrest . from ( 'users' ) . select ( ) . abortSignal ( ac . signal )
250
- expect ( res ) . toMatchInlineSnapshot ( `
250
+ expect ( res ) . toMatchInlineSnapshot (
251
+ { error : { details : expect . any ( String ) } } ,
252
+ `
251
253
Object {
252
254
"count": null,
253
255
"data": null,
254
256
"error": Object {
255
257
"code": "",
256
- "details": "" ,
258
+ "details": Any<String> ,
257
259
"hint": "",
258
- "message": "FetchError : The user aborted a request.",
260
+ "message": "AbortError : The user aborted a request.",
259
261
},
260
262
"status": 0,
261
263
"statusText": "",
262
264
}
263
- ` )
265
+ `
266
+ )
264
267
} )
265
268
266
269
// test('geojson', async () => {
You can’t perform that action at this time.
0 commit comments