mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: add missing fallback for plugins
This commit is contained in:
parent
1f7a8bd625
commit
031e54ef32
@ -716,6 +716,10 @@ export class BlockService extends BaseService<
|
||||
throw err;
|
||||
}
|
||||
} else if (block.message && 'plugin' in block.message) {
|
||||
if (fallback) {
|
||||
return envelopeFactory.buildTextEnvelope(fallback.message);
|
||||
}
|
||||
|
||||
const plugin = this.pluginService.findPlugin(
|
||||
PluginType.block,
|
||||
block.message.plugin,
|
||||
@ -731,7 +735,7 @@ export class BlockService extends BaseService<
|
||||
return envelope;
|
||||
} catch (e) {
|
||||
this.logger.error('Plugin was unable to load/process ', e);
|
||||
throw new Error(`Unknown plugin - ${JSON.stringify(block.message)}`);
|
||||
throw new Error(`Plugin Error - ${JSON.stringify(block.message)}`);
|
||||
}
|
||||
}
|
||||
throw new Error('Invalid message format.');
|
||||
|
Loading…
Reference in New Issue
Block a user