Skip to content

Commit c8622ac

Browse files
committed
cleanup
1 parent b9b7146 commit c8622ac

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

api-client/src/runs/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export interface UpdateErrorRecoveryPolicyRequest {
204204
}
205205

206206
export type UpdateErrorRecoveryPolicyResponse = Record<string, never>
207-
export type ErrorRecoveryPolicyResponse = ErrorRecoveryPolicy
207+
export type ErrorRecoveryPolicyResponse = UpdateErrorRecoveryPolicyRequest
208208

209209
/**
210210
* Current Run State Data

app/src/organisms/ErrorRecoveryFlows/hooks/useRecoveryCommands.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,10 @@ export function useRecoveryCommands({
229229

230230
return updateErrorRecoveryPolicy(ignorePolicyRules, 'append')
231231
.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+
)
234236
)
235237
} else {
236238
void proceedToRouteAndStep(RECOVERY_MAP.ERROR_WHILE_RECOVERING.ROUTE)

app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function useUpdateRecoveryPolicyWithStrategy(
3838
strategy: UpdateErrorRecoveryPolicyWithStrategy['strategy']
3939
) =>
4040
getErrorRecoveryPolicy(host as HostConfig, runId).then(res => {
41-
const existingPolicyRules = res.data.policyRules.map(rule => ({
41+
const existingPolicyRules = res.data.data.policyRules.map(rule => ({
4242
commandType: rule.matchCriteria.command.commandType,
4343
errorType: rule.matchCriteria.command.error.errorType,
4444
ifMatch: rule.ifMatch,
@@ -49,7 +49,7 @@ export function useUpdateRecoveryPolicyWithStrategy(
4949
case 'append':
5050
return [...existingPolicyRules, newPolicy]
5151
default: {
52-
console.error('Handled policy strategy, using append.')
52+
console.error('Unhandled policy strategy, defaulting to append.')
5353
return [...existingPolicyRules, newPolicy]
5454
}
5555
}

0 commit comments

Comments
 (0)