File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,16 @@ export class PaymentRequiredError extends HttpError {
2121 }
2222}
2323
24- class MaxInFlightRequestsError extends HttpError {
25- constructor ( message : string = 'Max In Flight Requests' ) {
26- super ( 429 , message ) ;
27- }
28- }
29-
3024export class UnknownModelError extends HttpError {
3125 constructor ( message : string = 'Unknown Model argument passed in' ) {
3226 super ( 400 , message ) ;
3327 }
3428}
29+
30+ export class FacilitatorProxyError extends HttpError {
31+ constructor (
32+ message : string = 'FacilitatorProxyError - all facilitators are busy. Please retry after a few seconds.'
33+ ) {
34+ super ( 513 , message ) ;
35+ }
36+ }
Original file line number Diff line number Diff line change 88import logger , { logMetric } from '../../logger' ;
99import dotenv from 'dotenv' ;
1010import { env } from '../../env' ;
11+ import { FacilitatorProxyError } from '../../errors/http' ;
1112
1213dotenv . config ( ) ;
1314
@@ -69,13 +70,11 @@ export async function facilitatorProxy<
6970 clearTimeout ( timeoutId ) ;
7071
7172 if ( res . status !== 200 ) {
72- const errorBody = await res . text ( ) ;
73- const errorMsg = `${ res . status } ${ res . statusText } - ${ errorBody } ` ;
7473 logMetric ( 'facilitator_proxy_failure' , 1 , {
7574 method,
7675 status : res . status ,
7776 } ) ;
78- throw new Error ( `Proxy facilitator failed for ${ method } : ${ errorMsg } ` ) ;
77+ throw new FacilitatorProxyError ( ) ;
7978 }
8079
8180 const data = await res . json ( ) ;
You can’t perform that action at this time.
0 commit comments