diff options
author | Veetaha <[email protected]> | 2020-03-14 01:01:14 +0000 |
---|---|---|
committer | Veetaha <[email protected]> | 2020-03-14 01:01:14 +0000 |
commit | 5e32a67c83d46862db0166c263efc65b6ecd5b52 (patch) | |
tree | 9fbc81a8cfef4d9d76b29d23d63c6a3126ee8f8e /editors/code/src/installation | |
parent | d7b46e0527cd7b52845f37cffc57cbae4ba0b945 (diff) |
vscode-postrefactor: more logging and better error handling
Diffstat (limited to 'editors/code/src/installation')
-rw-r--r-- | editors/code/src/installation/extension.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/editors/code/src/installation/extension.ts b/editors/code/src/installation/extension.ts index f6dd20d82..0d69b8d0c 100644 --- a/editors/code/src/installation/extension.ts +++ b/editors/code/src/installation/extension.ts | |||
@@ -44,10 +44,20 @@ export async function ensureProperExtensionVersion(config: Config): Promise<neve | |||
44 | 44 | ||
45 | const currentExtReleaseDate = config.installedNightlyExtensionReleaseDate.get(); | 45 | const currentExtReleaseDate = config.installedNightlyExtensionReleaseDate.get(); |
46 | 46 | ||
47 | assert(currentExtReleaseDate !== null, "nightly release date must've been set during installation"); | 47 | if (currentExtReleaseDate === null) { |
48 | void vscode.window.showErrorMessage( | ||
49 | "Nightly release date must've been set during the installation. " + | ||
50 | "Did you download and install the nightly .vsix package manually?" | ||
51 | ); | ||
52 | throw new Error("Nightly release date was not set in globalStorage"); | ||
53 | } | ||
48 | 54 | ||
49 | const hoursSinceLastUpdate = diffInHours(currentExtReleaseDate, new Date()); | 55 | const dateNow = new Date; |
50 | log.debug(`Current rust-analyzer nightly was downloaded ${hoursSinceLastUpdate} hours ago`); | 56 | const hoursSinceLastUpdate = diffInHours(currentExtReleaseDate, dateNow); |
57 | log.debug( | ||
58 | "Current rust-analyzer nightly was downloaded", hoursSinceLastUpdate, | ||
59 | "hours ago, namely:", currentExtReleaseDate, "and now is", dateNow | ||
60 | ); | ||
51 | 61 | ||
52 | if (hoursSinceLastUpdate < HEURISTIC_NIGHTLY_RELEASE_PERIOD_IN_HOURS) { | 62 | if (hoursSinceLastUpdate < HEURISTIC_NIGHTLY_RELEASE_PERIOD_IN_HOURS) { |
53 | return; | 63 | return; |