【问题标题】:discord bot crashing when i try to delete ticket当我尝试删除票证时,discord bot 崩溃
【发布时间】:2022-01-12 03:02:53
【问题描述】:

一切正常,但是当我尝试按下删除工单按钮时,它会使机器人崩溃,甚至不会删除工单 + 不会发送它应该发送的工单日志。

当我按下删除票按钮时出现错误:


2022-01-11T18:42:09.631377+00:00 app[Worker.1]:                     err = new got.ParseError(e, statusCode, opts);

2022-01-11T18:42:09.631378+00:00 app[Worker.1]:                           ^

2022-01-11T18:42:09.633302+00:00 app[Worker.1]: ErrorClass [ParseError]: Unexpected token '<' at 1:1 in https://hastebin.com/documents

2022-01-11T18:42:09.633304+00:00 app[Worker.1]: <!DOCTYPE HTML>

2022-01-11T18:42:09.633305+00:00 app[Worker.1]: ^

2022-01-11T18:42:09.633305+00:00 app[Worker.1]:     at /app/node_modules/got/index.js:115:12

2022-01-11T18:42:09.633306+00:00 app[Worker.1]:     at BufferStream.<anonymous> (/app/node_modules/read-all-stream/index.js:64:3)

2022-01-11T18:42:09.633306+00:00 app[Worker.1]:     at BufferStream.emit (node:events:402:35)

2022-01-11T18:42:09.633306+00:00 app[Worker.1]:     at finishMaybe (/app/node_modules/readable-stream/lib/_stream_writable.js:630:14)

2022-01-11T18:42:09.633307+00:00 app[Worker.1]:     at afterWrite (/app/node_modules/readable-stream/lib/_stream_writable.js:492:3)

2022-01-11T18:42:09.633307+00:00 app[Worker.1]:     at processTicksAndRejections (node:internal/process/task_queues:85:21) {

2022-01-11T18:42:09.633308+00:00 app[Worker.1]:   host: 'hastebin.com',

2022-01-11T18:42:09.633308+00:00 app[Worker.1]:   hostname: 'hastebin.com',

2022-01-11T18:42:09.633309+00:00 app[Worker.1]:   method: 'POST',

2022-01-11T18:42:09.633309+00:00 app[Worker.1]:   path: '/documents',

2022-01-11T18:42:09.633309+00:00 app[Worker.1]:   statusCode: 503,

2022-01-11T18:42:09.633309+00:00 app[Worker.1]:   statusMessage: 'Service Unavailable'

2022-01-11T18:42:09.633310+00:00 app[Worker.1]: }

2022-01-11T18:42:09.938311+00:00 heroku[Worker.1]: State changed from up to crashed``` 

【问题讨论】:

    标签: javascript node.js discord


    【解决方案1】:

    503service unavailable 错误看来,当您遇到此错误时,hastebin 遇到了问题/停机。确保在发送请求和从 Web 服务器接收 HTTP 响应时检查状态代码或捕获错误。您遇到了一个致命错误,因为您可能试图将 HTML 错误页面正文解析为 JSON。

    【讨论】:

      猜你喜欢
      • 2021-10-16
      • 2020-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-28
      • 1970-01-01
      • 2019-03-12
      • 1970-01-01
      相关资源
      最近更新 更多