Skip to content

Commit

Permalink
fixes #166
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 committed Oct 21, 2020
1 parent eba0c14 commit f4f41fa
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 36 deletions.
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"datadog-metrics": "^0.8.1",
"debug": "~2.6.9",
"del-i18n": "github:discordextremelist/i18n",
"discord-api-types": "^0.6.0",
"discord.js": "^12.3.1",
"discord-api-types": "^0.7.0",
"discord.js": "^12.4.0",
"ejs": "^3.1.5",
"express": "~4.17.1",
"express-device": "^0.4.2",
Expand Down Expand Up @@ -47,14 +47,14 @@
"@types/cookie-parser": "^1.4.2",
"@types/cookie-session": "^2.0.41",
"@types/datadog-metrics": "^0.6.0",
"@types/ejs": "^3.0.4",
"@types/ejs": "^3.0.5",
"@types/express": "^4.17.8",
"@types/http-errors": "^1.8.0",
"@types/i18n": "^0.8.7",
"@types/ioredis": "^4.17.5",
"@types/mongodb": "^3.5.27",
"@types/ioredis": "^4.17.6",
"@types/mongodb": "^3.5.29",
"@types/morgan": "^1.9.1",
"@types/node": "^14.11.8",
"@types/node": "^14.14.0",
"@types/passport": "^1.0.4",
"@types/passport-discord": "^0.1.3",
"@types/sanitize-html": "^1.27.0",
Expand Down
18 changes: 11 additions & 7 deletions src/Routes/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -978,16 +978,20 @@ router.get(
})
.catch((error: DiscordAPIError) => {
if(error.code === 10057)
return res.status(400).json({
error: true,
return res.status(400).render("status", {
title: res.__("common.error"),
status: 400,
errors: [res.__("common.error.template.arr.invite.invalid")]
subtitle: res.__("common.error.template.arr.invite.invalid"),
req,
type: "Error"
});

return res.status(400).json({
error: true,
return res.status(400).render("status", {
title: res.__("common.error"),
status: 400,
errors: [`${error.name}: ${error.message}`, `${error.httpStatus} ${error.method} ${error.path}`]
subtitle: `${error.name}: ${error.message} | ${error.httpStatus} ${error.method} ${error.path}`,
req,
type: "Error"
});
});

Expand Down

0 comments on commit f4f41fa

Please sign in to comment.