mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 09:16:16 +00:00
feat: implement error logging in catch blocks for improved error handling and debugging
This commit is contained in:
12
src/index.ts
12
src/index.ts
@@ -120,10 +120,16 @@ export class MicrosoftRewardsBot {
|
||||
|
||||
// Run comprehensive startup validation
|
||||
const validator = new StartupValidator()
|
||||
await validator.validate(this.config, this.accounts)
|
||||
try {
|
||||
await validator.validate(this.config, this.accounts)
|
||||
} catch (error) {
|
||||
// Critical validation errors prevent startup
|
||||
const errorMsg = error instanceof Error ? error.message : String(error)
|
||||
log('main', 'VALIDATION', `Fatal validation error: ${errorMsg}`, 'error')
|
||||
throw error // Re-throw to stop execution
|
||||
}
|
||||
|
||||
// Always continue - validation is informative, not blocking
|
||||
// This allows users to proceed even with warnings or minor issues
|
||||
// Validation passed - continue with initialization
|
||||
|
||||
// Initialize job state
|
||||
if (this.config.jobState?.enabled !== false) {
|
||||
|
||||
Reference in New Issue
Block a user