mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 18:01:08 +01:00
Plugin tweaks
This commit is contained in:
@@ -79,14 +79,14 @@ export class PluginHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async #handleError(err: Error) {
|
async #handleError(err: Error) {
|
||||||
console.error('PLUGIN ERROR', this.pluginDir, err);
|
console.error('Plugin errored', this.pluginDir, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
async #handleExit(code: number) {
|
async #handleExit(code: number) {
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
console.log('PLUGIN EXITED SUCCESSFULLY');
|
console.log('Plugin exited successfully', this.pluginDir);
|
||||||
} else {
|
} else {
|
||||||
console.log('PLUGIN EXITED CODE', code);
|
console.log('Plugin exited with error', code, this.pluginDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,4 +61,6 @@ new Promise(async () => {
|
|||||||
replyErr(msg, err);
|
replyErr(msg, err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch((err) => console.log('failed to boot plugin', err));
|
}).catch((err) => {
|
||||||
|
console.log('failed to boot plugin', err);
|
||||||
|
});
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export interface PluginInfo {
|
|||||||
|
|
||||||
export function loadPlugins(): PluginHandle[] {
|
export function loadPlugins(): PluginHandle[] {
|
||||||
const pluginsDir = process.env.YAAK_PLUGINS_DIR;
|
const pluginsDir = process.env.YAAK_PLUGINS_DIR;
|
||||||
if (!pluginsDir) throw new Error('PLUGINS_DIR is not set');
|
if (!pluginsDir) throw new Error('YAAK_PLUGINS_DIR is not set');
|
||||||
console.log('Loading plugins from', pluginsDir);
|
console.log('Loading plugins from', pluginsDir);
|
||||||
|
|
||||||
const pluginDirs = fs.readdirSync(pluginsDir).map((p) => path.join(pluginsDir, p));
|
const pluginDirs = fs.readdirSync(pluginsDir).map((p) => path.join(pluginsDir, p));
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export function GrpcProtoSelection({ requestId }: Props) {
|
|||||||
{reflectError && (
|
{reflectError && (
|
||||||
<Banner color="warning">
|
<Banner color="warning">
|
||||||
<h1 className="font-bold">
|
<h1 className="font-bold">
|
||||||
Reflection failed on URL <InlineCode>{request.url}</InlineCode>
|
Reflection failed on URL <InlineCode>{request.url || 'n/a'}</InlineCode>
|
||||||
</h1>
|
</h1>
|
||||||
{reflectError}
|
{reflectError}
|
||||||
</Banner>
|
</Banner>
|
||||||
|
|||||||
Reference in New Issue
Block a user