From ed2bc49b0cb8ddfc6b43811779e18e613de8297d Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Tue, 30 Jul 2024 15:38:40 -0500 Subject: [PATCH] catch errors --- .dist/permissions.js | 12 +++++++++--- webpage/permissions.ts | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.dist/permissions.js b/.dist/permissions.js index 2e11163..0c4f19e 100644 --- a/.dist/permissions.js +++ b/.dist/permissions.js @@ -5,9 +5,15 @@ class Permissions { hasDeny; constructor(allow, deny = "") { this.hasDeny = !!deny; - console.log(allow,deny); - this.allow = BigInt(allow); - this.deny = BigInt(deny); + try { + this.allow = BigInt(allow); + this.deny = BigInt(deny); + } + catch (e) { + this.allow = 0n; + this.deny = 0n; + console.error(`Something really stupid happened with a permission with allow being ${allow} and deny being, ${deny}, execution will still happen, but something really stupid happened, please report if you know what caused this.`); + } } getPermissionbit(b, big) { return Boolean((big >> BigInt(b)) & 1n); diff --git a/webpage/permissions.ts b/webpage/permissions.ts index 3bce00f..af8841f 100644 --- a/webpage/permissions.ts +++ b/webpage/permissions.ts @@ -5,8 +5,14 @@ class Permissions{ readonly hasDeny:boolean; constructor(allow:string,deny:string=""){ this.hasDeny=!!deny; - this.allow=BigInt(allow); - this.deny=BigInt(deny); + try{ + this.allow = BigInt(allow); + this.deny = BigInt(deny); + }catch(e){ + this.allow = 0n; + this.deny = 0n; + console.error(`Something really stupid happened with a permission with allow being ${allow} and deny being, ${deny}, execution will still happen, but something really stupid happened, please report if you know what caused this.`) + } } getPermissionbit(b:number,big:bigint) : boolean{ return Boolean((big>>BigInt(b))&1n);