Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Just log a warning when trying automatic login, but nodecg-io is already loaded #385

Merged
merged 1 commit into from
Dec 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion nodecg-io-core/extension/persistenceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,17 @@ export class PersistenceManager {
throw loadResult.errorMessage;
}
} catch (err) {
this.nodecg.log.error(`Failed to automatically login: ${err}`);
const logMesssage = `Failed to automatically login: ${err}`;
if (this.isLoaded()) {
// load() threw an error but nodecg-io is currently loaded nonetheless.
// Propably because the a already open dashboard automatically logged in after reconnecting.
// Anyway, nodecg-io is loaded which is what we wanted
this.nodecg.log.warn(logMesssage);
} else {
// Something went wrong and nodecg-io is not loaded.
// This is a real error, the password might be wrong or some other issue.
this.nodecg.log.error(logMesssage);
}
}
}
});
Expand Down