catch errors
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user