Handle plugin load errors gracefully
This commit is contained in:
parent
fcc3c17b73
commit
557898e484
4 changed files with 38 additions and 18 deletions
|
@ -76,10 +76,9 @@ export function initGuildsAPI(app: express.Express) {
|
|||
parsedConfig = {};
|
||||
}
|
||||
|
||||
const errors = await validateGuildConfig(parsedConfig);
|
||||
|
||||
if (errors) {
|
||||
return res.status(422).json({ errors });
|
||||
const error = await validateGuildConfig(parsedConfig);
|
||||
if (error) {
|
||||
return res.status(422).json({ errors: [error] });
|
||||
}
|
||||
|
||||
await configs.saveNewRevision(`guild-${req.params.guildId}`, config, req.user.userId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue