File tree 2 files changed +8
-3
lines changed
packages/qwik-city/src/runtime/src
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @builder.io/qwik-city ' : patch
3
+ ---
4
+
5
+ server$ functions now correctly throw errors for > 500 error codes
Original file line number Diff line number Diff line change @@ -479,19 +479,19 @@ export const serverQrl = <T extends ServerFunction>(
479
479
} else if ( contentType === 'application/qwik-json' ) {
480
480
const str = await res . text ( ) ;
481
481
const obj = await _deserializeData ( str , ctxElm ?? document . documentElement ) ;
482
- if ( res . status == = 500 ) {
482
+ if ( res . status > = 500 ) {
483
483
throw obj ;
484
484
}
485
485
return obj ;
486
486
} else if ( contentType === 'application/json' ) {
487
487
const obj = await res . json ( ) ;
488
- if ( res . status == = 500 ) {
488
+ if ( res . status > = 500 ) {
489
489
throw obj ;
490
490
}
491
491
return obj ;
492
492
} else if ( contentType === 'text/plain' || contentType === 'text/html' ) {
493
493
const str = await res . text ( ) ;
494
- if ( res . status == = 500 ) {
494
+ if ( res . status > = 500 ) {
495
495
throw str ;
496
496
}
497
497
return str ;
You can’t perform that action at this time.
0 commit comments