File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export class APIError extends OpenAIError {
61
61
headers : Headers | undefined ,
62
62
) {
63
63
if ( ! status ) {
64
- return new APIConnectionError ( { cause : castToError ( errorResponse ) } ) ;
64
+ return new APIConnectionError ( { message , cause : castToError ( errorResponse ) } ) ;
65
65
}
66
66
67
67
const error = ( errorResponse as Record < string , any > ) ?. [ 'error' ] ;
@@ -113,7 +113,7 @@ export class APIUserAbortError extends APIError {
113
113
export class APIConnectionError extends APIError {
114
114
override readonly status : undefined = undefined ;
115
115
116
- constructor ( { message, cause } : { message ?: string ; cause ?: Error | undefined } ) {
116
+ constructor ( { message, cause } : { message ?: string | undefined ; cause ?: Error | undefined } ) {
117
117
super ( undefined , undefined , message || 'Connection error.' , undefined ) ;
118
118
// in some environments the 'cause' property is already declared
119
119
// @ts -ignore
You can’t perform that action at this time.
0 commit comments