firmware/sagas: fix missing error arg when unknown reason

For some reason, the type checker doesn't catch this, but
FailToFinishReasonType.Unknown requires an error argument, otherwise
we get an unhandled exception.
This commit is contained in:
David Lechner
2025-08-30 19:12:53 -04:00
parent 00516f2a39
commit fa21abc7ec
+3 -3
View File
@@ -1251,7 +1251,7 @@ function* handleFlashEV3(action: ReturnType<typeof firmwareFlashEV3>): Generator
}),
);
// FIXME: should have a better error reason
yield* put(didFailToFinish(FailToFinishReasonType.Unknown));
yield* put(didFailToFinish(FailToFinishReasonType.Unknown, eraseError));
yield* put(firmwareDidFailToFlashEV3());
yield* cleanup();
return;
@@ -1268,7 +1268,7 @@ function* handleFlashEV3(action: ReturnType<typeof firmwareFlashEV3>): Generator
}),
);
// FIXME: should have a better error reason
yield* put(didFailToFinish(FailToFinishReasonType.Unknown));
yield* put(didFailToFinish(FailToFinishReasonType.Unknown, sendError));
yield* put(firmwareDidFailToFlashEV3());
yield* cleanup();
return;
@@ -1309,7 +1309,7 @@ function* handleFlashEV3(action: ReturnType<typeof firmwareFlashEV3>): Generator
const [, rebootError] = yield* sendCommand(0xf4); // start app
if (rebootError) {
// FIXME: should have a better error reason
yield* put(didFailToFinish(FailToFinishReasonType.Unknown));
yield* put(didFailToFinish(FailToFinishReasonType.Unknown, rebootError));
yield* put(firmwareDidFailToFlashEV3());
yield* cleanup();
return;