Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): updater failures log the error code and exit status #14008

ClosedTonybynMp4(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/14008/headopened View on GitHub

Showing 2 changed files with 68 additions and 2 deletions.

x
0 of 2 viewed, 2 left
43 additions and 2 deletionsapps/desktop/src/updates/DesktopUpdates.test.tsModified
View file
@@ -431,8 +431,9 @@
});
​
it.effect("logs bounded updater failure context without exposing the cause", () => {
- const cause = new Error(
- "request failed for https://user:secret@example.com/update?token=secret",
+ const cause = Object.assign(
+ new Error("request failed for https://user:secret@example.com/update?token=secret"),
+ { code: "HTTP_ERROR_404" },
const updaterError = new ElectronUpdater.ElectronUpdaterCheckForUpdatesError({
channel: null,
@@ -459,6 +460,7 @@
assert.isDefined(loggedAnnotation);
assert.equal(loggedAnnotation.errorTag, "ElectronUpdaterCheckForUpdatesError");
assert.isNull(loggedAnnotation.channel);
+ assert.equal(loggedAnnotation.errorCode, "HTTP_ERROR_404");
assert.notProperty(loggedAnnotation, "error");
assert.notInclude(Object.values(loggedAnnotation).map(String).join(" "), "secret");
assert.equal(
@@ -728,6 +730,45 @@
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
});
​
+ it.effect("logs the exit status of a refused installer command", () => {
+ const harness = makeHarness();
+ const loggedAnnotations: Array<Record<string, unknown>> = [];
+ const logger = Logger.make(({ fiber }) => {