summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:05:46 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:05:46 +0200
commit4f67c2c86e1a418c66ef5bab9712b2dc289d83fc (patch)
treec7692ee967473f18b2076afee714e83c9669e8e0 /src
parent:bug: fix guild schema (diff)
downloadserver-4f67c2c86e1a418c66ef5bab9712b2dc289d83fc.tar.xz
:art: proper error message body parser
Diffstat (limited to 'src')
-rw-r--r--src/util/instanceOf.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util/instanceOf.ts b/src/util/instanceOf.ts

index eb2894cd..869f56d4 100644 --- a/src/util/instanceOf.ts +++ b/src/util/instanceOf.ts
@@ -148,8 +148,11 @@ export function instanceOf( }) ); } - if (value instanceof type) return true; - throw new FieldError("BASE_TYPE_CLASS", req.t("common:field.BASE_TYPE_CLASS", { type })); + try { + if (value instanceof type) return true; + } catch (error) { + throw new FieldError("BASE_TYPE_CLASS", req.t("common:field.BASE_TYPE_CLASS", { type })); + } } if (typeof value !== "object") throw new FieldError("BASE_TYPE_OBJECT", req.t("common:field.BASE_TYPE_OBJECT"));