From 8f990576f58e50351cb3abdfdb577690d02145f8 Mon Sep 17 00:00:00 2001 From: Matt Galloway Date: Thu, 14 May 2020 10:08:32 +0100 Subject: [PATCH] fix(auto-updater): Log the raw version string (#4947) When the app updater fails because the version string can't be parsed, we are putting `latestVersion` into the logs, which we know is `null`. That's not too helpful, but putting the raw string from `updateInfo.version` is helpful because you might be able to see what's gone wrong with parsing it. --- packages/electron-updater/src/AppUpdater.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index fb5f23d0234..a4881622cc3 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -305,7 +305,7 @@ export abstract class AppUpdater extends EventEmitter { private async isUpdateAvailable(updateInfo: UpdateInfo): Promise { const latestVersion = parseVersion(updateInfo.version) if (latestVersion == null) { - throw newError(`This file could not be downloaded, or the latest version (from update server) does not have a valid semver version: "${latestVersion}"`, "ERR_UPDATER_INVALID_VERSION") + throw newError(`This file could not be downloaded, or the latest version (from update server) does not have a valid semver version: "${updateInfo.version}"`, "ERR_UPDATER_INVALID_VERSION") } const currentVersion = this.currentVersion @@ -670,4 +670,4 @@ export interface TestOnlyUpdaterOptions { platform: ProviderPlatform isUseDifferentialDownload?: boolean -} \ No newline at end of file +}