File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -790,7 +790,12 @@ export async function tryTargetsRecursively(
790
790
// tryPost always returns a Response.
791
791
// TypeError will check for all unhandled exceptions.
792
792
// GatewayError will check for all handled exceptions which cannot allow the request to proceed.
793
- if ( error instanceof TypeError || error instanceof GatewayError ) {
793
+ if (
794
+ error instanceof TypeError ||
795
+ error instanceof GatewayError ||
796
+ ! error . response ||
797
+ ( error . response && ! ( error . response instanceof Response ) )
798
+ ) {
794
799
console . error (
795
800
'tryTargetsRecursively error: ' ,
796
801
error . message ,
Original file line number Diff line number Diff line change @@ -8,11 +8,12 @@ import {
8
8
import Providers from '../../providers' ;
9
9
import { RequestContext } from './requestContext' ;
10
10
import { ANTHROPIC , AZURE_OPEN_AI } from '../../globals' ;
11
+ import { GatewayError } from '../../errors/GatewayError' ;
11
12
12
13
export class ProviderContext {
13
14
constructor ( private provider : string ) {
14
15
if ( ! Providers [ provider ] ) {
15
- throw new Error ( `Provider ${ provider } not found` ) ;
16
+ throw new GatewayError ( `Provider ${ provider } not found` ) ;
16
17
}
17
18
}
18
19
You can’t perform that action at this time.
0 commit comments