Skip to content

Commit

Permalink
Catch and log early init errors
Browse files Browse the repository at this point in the history
Prior to this change, it was possible for errors initializing or waiting
on plugins to go undetected. Errors in wait() would bubble up to the
"no-network" error, which has been even more confusing for users.

Related, but does not fix:
#1847
  • Loading branch information
UniversalSuperBox committed Apr 12, 2021
1 parent e28ce31 commit 4f3899c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ class Core {
* @returns {Promise}
*/
prepare(file) {
return Promise.all([this.readConfigFile(file), this.plugins.init()]).then(
return Promise.all([
this.readConfigFile(file),
this.plugins.init().catch(e => errors.toUser(e, "initializing plugins")),
]).then(
() => {
if (this.props.config) {
this.selectOs();
} else {
const wait = this.plugins
.wait()
.catch( e => errors.toUser(e, "plugin wait()"))
.then(device => api.resolveAlias(device))
.catch(
e =>
Expand Down

0 comments on commit 4f3899c

Please sign in to comment.