Skip to content

Commit fa21abc

Browse files
committed
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.
1 parent 00516f2 commit fa21abc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/firmware/sagas.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ function* handleFlashEV3(action: ReturnType<typeof firmwareFlashEV3>): Generator
12511251
}),
12521252
);
12531253
// FIXME: should have a better error reason
1254-
yield* put(didFailToFinish(FailToFinishReasonType.Unknown));
1254+
yield* put(didFailToFinish(FailToFinishReasonType.Unknown, eraseError));
12551255
yield* put(firmwareDidFailToFlashEV3());
12561256
yield* cleanup();
12571257
return;
@@ -1268,7 +1268,7 @@ function* handleFlashEV3(action: ReturnType<typeof firmwareFlashEV3>): Generator
12681268
}),
12691269
);
12701270
// FIXME: should have a better error reason
1271-
yield* put(didFailToFinish(FailToFinishReasonType.Unknown));
1271+
yield* put(didFailToFinish(FailToFinishReasonType.Unknown, sendError));
12721272
yield* put(firmwareDidFailToFlashEV3());
12731273
yield* cleanup();
12741274
return;
@@ -1309,7 +1309,7 @@ function* handleFlashEV3(action: ReturnType<typeof firmwareFlashEV3>): Generator
13091309
const [, rebootError] = yield* sendCommand(0xf4); // start app
13101310
if (rebootError) {
13111311
// FIXME: should have a better error reason
1312-
yield* put(didFailToFinish(FailToFinishReasonType.Unknown));
1312+
yield* put(didFailToFinish(FailToFinishReasonType.Unknown, rebootError));
13131313
yield* put(firmwareDidFailToFlashEV3());
13141314
yield* cleanup();
13151315
return;

0 commit comments

Comments
 (0)