File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ export class ChatController {
37
37
stream ,
38
38
) ;
39
39
40
+ if ( response . status > 299 || response . status < 200 ) {
41
+ res . status ( response . status ) ;
42
+ res . send ( response . data ) ;
43
+ return ;
44
+ }
45
+
40
46
// set response headers
41
47
for ( const [ key , value ] of response . headers as AxiosHeaders ) {
42
48
res . header [ key ] = value ;
Original file line number Diff line number Diff line change @@ -36,7 +36,11 @@ export class AppService {
36
36
config [ 'responseType' ] = 'stream' ;
37
37
}
38
38
const ret = this . httpService . post ( url , body , config ) ;
39
- return await firstValueFrom ( ret ) ;
39
+ try {
40
+ return await firstValueFrom ( ret ) ;
41
+ } catch ( e ) {
42
+ return e . response ;
43
+ }
40
44
}
41
45
private getDeploymentId ( mapping : string , model : string ) : string {
42
46
this . logger . debug ( `mapping: ${ mapping } , model: ${ model } ` ) ;
You can’t perform that action at this time.
0 commit comments