File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @al/core" ,
3
- "version" : " 1.0.189 " ,
3
+ "version" : " 1.0.190 " ,
4
4
"description" : " Node Enterprise Packages for Alert Logic (NEPAL) Core Library" ,
5
5
"main" : " ./dist/index.cjs.js" ,
6
6
"types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ import {
54
54
AlInterceptionRule ,
55
55
AlInterceptionRules ,
56
56
} from './types' ;
57
- import { AlClientBeforeRequestEvent } from './events' ;
57
+ import { AlClientBeforeRequestEvent , AlClientAPIErrorEvent } from './events' ;
58
58
import { AIMSSessionDescriptor } from '../aims-client/types' ;
59
59
import { AlRuntimeConfiguration , ConfigOption } from '../configuration' ;
60
60
import { commonTypeSchematics } from './common.schematics' ;
@@ -975,6 +975,7 @@ export class AlApiClient implements AlValidationSchemaProvider
975
975
data : errorResponse . data
976
976
} ;
977
977
this . log ( `APIClient Failed Request Snapshot: ${ JSON . stringify ( snapshot , null , 4 ) } ` ) ;
978
+ this . events . trigger ( new AlClientAPIErrorEvent ( errorResponse . config , errorResponse ) ) ;
978
979
return Promise . reject ( errorResponse ) ;
979
980
}
980
981
Original file line number Diff line number Diff line change 1
- import { AxiosRequestConfig } from 'axios' ;
1
+ import { AxiosRequestConfig , AxiosResponse } from 'axios' ;
2
2
import {
3
3
AlTrigger ,
4
4
AlTriggeredEvent ,
@@ -12,3 +12,11 @@ export class AlClientBeforeRequestEvent extends AlTriggeredEvent<void>
12
12
super ( ) ;
13
13
}
14
14
}
15
+
16
+ @AlTrigger ( 'AlClientAPIError' )
17
+ export class AlClientAPIErrorEvent extends AlTriggeredEvent < void >
18
+ {
19
+ constructor ( public request :APIRequestParams , public errorResponse :AxiosResponse ) {
20
+ super ( ) ;
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments