Browse Source

优化 BotService 中的错误日志记录,调整错误信息输出格式以提供更详细的调试信息。

wuyi 3 months ago
parent
commit
19b1f64944
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/services/bot.service.ts

+ 2 - 2
src/services/bot.service.ts

@@ -39,13 +39,13 @@ export class BotService {
 
 
       // 添加启动错误处理
       // 添加启动错误处理
       this.bot.launch().catch(error => {
       this.bot.launch().catch(error => {
-        this.app.log.error('Telegram Bot 启动失败:', error.message)
+        this.app.log.error('Telegram Bot 启动失败:' + error)
         this.app.log.error('请检查网络连接和 BOT_TOKEN 是否正确')
         this.app.log.error('请检查网络连接和 BOT_TOKEN 是否正确')
       })
       })
 
 
       this.app.log.info('Telegram bot started')
       this.app.log.info('Telegram bot started')
     } catch (error) {
     } catch (error) {
-      this.app.log.error('BotService 初始化失败:', error)
+      this.app.log.error('BotService 初始化失败:' + error)
     }
     }
   }
   }