catch errors
This commit is contained in:
parent
7009138be5
commit
ed2bc49b0c
2 changed files with 17 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue