Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit f244558

Browse files
committed
Handle exceptional _promptToUpdateToolchain() result
1 parent 63dd0f7 commit f244558

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,20 +418,21 @@ class RustLanguageClient extends AutoLanguageClient {
418418
.then(() => checkRls(this.busySignalService))
419419
.then(() => this._restartLanguageServers(`Switched Rls toolchain to \`${newValue}\``))
420420
.then(() => this._promptToUpdateToolchain())
421+
.catch(e => e && console.warn(e))
421422
}, 1000)
422423
))
423424

424425
// watch config toolchain updates -> check for updates if enabling
425426
this.disposables.add(atom.config.onDidChange('ide-rust.checkForToolchainUpdates',
426427
({ newValue: enabled }) => {
427-
if (enabled) this._promptToUpdateToolchain()
428+
if (enabled) this._promptToUpdateToolchain().catch(e => e && console.warn(e))
428429
}
429430
))
430431

431432
// check for updates (if enabled) every so often
432433
let periodicUpdateTimeoutId
433-
const periodicUpdate = () => {
434-
this._promptToUpdateToolchain()
434+
const periodicUpdate = async () => {
435+
await this._promptToUpdateToolchain().catch(e => e && console.warn(e))
435436
periodicUpdateTimeoutId = setTimeout(periodicUpdate, PERIODIC_UPDATE_CHECK_MILLIS)
436437
}
437438
this.disposables.add(new Disposable(() => {

0 commit comments

Comments
 (0)