mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
feat(BitField): add problematic bit to error (#4617)
This commit is contained in:
parent
2a7f749d5a
commit
0225851e40
1 changed files with 3 additions and 1 deletions
|
|
@ -147,7 +147,9 @@ class BitField {
|
|||
if (bit instanceof BitField) return bit.bitfield;
|
||||
if (Array.isArray(bit)) return bit.map(p => this.resolve(p)).reduce((prev, p) => prev | p, 0);
|
||||
if (typeof bit === 'string' && typeof this.FLAGS[bit] !== 'undefined') return this.FLAGS[bit];
|
||||
throw new RangeError('BITFIELD_INVALID');
|
||||
const error = new RangeError('BITFIELD_INVALID');
|
||||
error.bit = bit;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue