File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
libs/shared/ofrep-core/src/lib/api Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class OFREPApiUnauthorizedError extends OFREPApiError {
3232 super ( undefined , response , message , options ) ;
3333 Object . setPrototypeOf ( this , OFREPApiUnauthorizedError . prototype ) ;
3434 this . name = OFREPApiUnauthorizedError . name ;
35+ this . message = message ?? 'OFREP request failed: unauthorized' ;
3536 }
3637}
3738
@@ -40,6 +41,7 @@ export class OFREPForbiddenError extends OFREPApiError {
4041 super ( undefined , response , message , options ) ;
4142 Object . setPrototypeOf ( this , OFREPForbiddenError . prototype ) ;
4243 this . name = OFREPForbiddenError . name ;
44+ this . message = message ?? 'OFREP request failed: forbidden' ;
4345 }
4446}
4547
Original file line number Diff line number Diff line change @@ -84,15 +84,15 @@ export class OFREPApi {
8484 }
8585
8686 if ( response . status === 401 ) {
87- throw new OFREPApiUnauthorizedError ( response , 'OFREP request failed: unauthorized' ) ;
87+ throw new OFREPApiUnauthorizedError ( response ) ;
8888 }
8989
9090 if ( response . status === 403 ) {
91- throw new OFREPForbiddenError ( response , 'OFREP request failed: forbidden' ) ;
91+ throw new OFREPForbiddenError ( response ) ;
9292 }
9393
9494 if ( response . status === 429 ) {
95- throw new OFREPApiTooManyRequestsError ( response , 'OFREP request failed: too many requests' ) ;
95+ throw new OFREPApiTooManyRequestsError ( response ) ;
9696 }
9797
9898 if ( response . status === 200 && ! this . isJsonMime ( response ) ) {
You can’t perform that action at this time.
0 commit comments