mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
feat(BitField): add problematic bit to error (#4617)
This commit is contained in:
@@ -147,7 +147,9 @@ class BitField {
|
|||||||
if (bit instanceof BitField) return bit.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 (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];
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user