Skip to content

Commit

Permalink
server: log plugin load failure
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Jun 1, 2024
1 parent 9c0fbc1 commit 2e07788
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions server/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,19 @@ export class ScryptedRuntime extends PluginHttp<HttpPluginData> {
this.invalidatePluginDevice(pluginDevice._id);
}

const pluginHost = new PluginHost(this, plugin, pluginDebug);
this.setupPluginHostAutoRestart(pluginHost);
this.plugins[pluginId] = pluginHost;
try {
const pluginHost = new PluginHost(this, plugin, pluginDebug);
this.setupPluginHostAutoRestart(pluginHost);
this.plugins[pluginId] = pluginHost;

return pluginHost;
return pluginHost;
}
catch (e) {
const logger = this.getDeviceLogger(this.findPluginDevice(pluginId));
logger.log('e', 'error loading plugin');
logger.log('e', e.toString());
throw e;
}
}

probePluginDevices(plugin: Plugin) {
Expand Down

0 comments on commit 2e07788

Please sign in to comment.