From 828385d0ebf7c677694d50e8acd3f730533cb1c2 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 22 Jul 2019 02:00:04 +0300 Subject: [PATCH] Fix YAML errors not showing the proper error message in config editor --- src/api/guilds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/guilds.ts b/src/api/guilds.ts index 48b31b2b..9087c558 100644 --- a/src/api/guilds.ts +++ b/src/api/guilds.ts @@ -47,7 +47,7 @@ export function initGuildsAPI(app: express.Express) { parsedConfig = yaml.safeLoad(config); } catch (e) { if (e instanceof YAMLException) { - return error(res, e.message, 400); + return res.status(400).json({ errors: [e.message] }); } console.error("Error when loading YAML: " + e.message);