mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:26:21 +00:00
chore: plugin command error wrap raw error object
This commit is contained in:
parent
6665aca695
commit
02742c3c76
@ -23,7 +23,7 @@ export default (app: Application) => {
|
|||||||
try {
|
try {
|
||||||
await app.pm.addViaCLI(name, _.cloneDeep(options));
|
await app.pm.addViaCLI(name, _.cloneDeep(options));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new PluginCommandError(`Failed to add plugin: ${error.message}`);
|
throw new PluginCommandError(`Failed to add plugin`, { cause: error });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ export default (app: Application) => {
|
|||||||
packageName,
|
packageName,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new PluginCommandError(`Failed to update plugin: ${error.message}`);
|
throw new PluginCommandError(`Failed to update plugin`, { cause: error });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ export default (app: Application) => {
|
|||||||
try {
|
try {
|
||||||
await app.pm.enable(plugins);
|
await app.pm.enable(plugins);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new PluginCommandError(`Failed to enable plugin: ${error.message}`);
|
throw new PluginCommandError(`Failed to enable plugin`, { cause: error });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ export default (app: Application) => {
|
|||||||
try {
|
try {
|
||||||
await app.pm.disable(plugins);
|
await app.pm.disable(plugins);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new PluginCommandError(`Failed to disable plugin: ${error.message}`);
|
throw new PluginCommandError(`Failed to disable plugin`, { cause: error });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user