mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 18:46:17 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user