File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
organisms/ErrorRecoveryFlows/hooks Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ export interface UpdateErrorRecoveryPolicyRequest {
204
204
}
205
205
206
206
export type UpdateErrorRecoveryPolicyResponse = Record < string , never >
207
- export type ErrorRecoveryPolicyResponse = ErrorRecoveryPolicy
207
+ export type ErrorRecoveryPolicyResponse = UpdateErrorRecoveryPolicyRequest
208
208
209
209
/**
210
210
* Current Run State Data
Original file line number Diff line number Diff line change @@ -229,8 +229,10 @@ export function useRecoveryCommands({
229
229
230
230
return updateErrorRecoveryPolicy ( ignorePolicyRules , 'append' )
231
231
. then ( ( ) => Promise . resolve ( ) )
232
- . catch ( ( ) =>
233
- Promise . reject ( new Error ( 'Failed to update recovery policy.' ) )
232
+ . catch ( ( e : Error ) =>
233
+ Promise . reject (
234
+ new Error ( `Failed to update recovery policy: ${ e . message } ` )
235
+ )
234
236
)
235
237
} else {
236
238
void proceedToRouteAndStep ( RECOVERY_MAP . ERROR_WHILE_RECOVERING . ROUTE )
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function useUpdateRecoveryPolicyWithStrategy(
38
38
strategy : UpdateErrorRecoveryPolicyWithStrategy [ 'strategy' ]
39
39
) =>
40
40
getErrorRecoveryPolicy ( host as HostConfig , runId ) . then ( res => {
41
- const existingPolicyRules = res . data . policyRules . map ( rule => ( {
41
+ const existingPolicyRules = res . data . data . policyRules . map ( rule => ( {
42
42
commandType : rule . matchCriteria . command . commandType ,
43
43
errorType : rule . matchCriteria . command . error . errorType ,
44
44
ifMatch : rule . ifMatch ,
@@ -49,7 +49,7 @@ export function useUpdateRecoveryPolicyWithStrategy(
49
49
case 'append' :
50
50
return [ ...existingPolicyRules , newPolicy ]
51
51
default : {
52
- console . error ( 'Handled policy strategy, using append.' )
52
+ console . error ( 'Unhandled policy strategy, defaulting to append.' )
53
53
return [ ...existingPolicyRules , newPolicy ]
54
54
}
55
55
}
You can’t perform that action at this time.
0 commit comments