mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-02-01 01:41:02 +00:00
feat: Improve error logging and validation across various flows and utilities
This commit is contained in:
@@ -123,6 +123,11 @@ export class Util {
|
||||
return []
|
||||
}
|
||||
|
||||
// Check for undefined/null elements which could cause issues downstream
|
||||
if (arr.some(item => item === undefined || item === null)) {
|
||||
throw new Error('Array contains undefined or null elements which are not allowed.')
|
||||
}
|
||||
|
||||
if (!Number.isFinite(numChunks) || numChunks <= 0) {
|
||||
throw new Error(`Invalid numChunks: ${numChunks}. Must be a positive finite number.`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user