84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
我有以下處理http請求的程式碼。
request.connection.addListener('close', function(had_error) { console.log(had_error); ...
我想列印更多錯誤訊息,但它只列印“true”。
使用錯誤事件來追蹤錯誤。它會傳回包含完整詳細資訊的 Error 物件。
request.connection.addListener('error', function(error) { console.log(error.reason|| error.message); });
由於連線已從 v15 開始被棄用,如果您使用的是最新版本,也可以使用它
request.on('error',function(error){ console.log(error.reason|| error.message); });
使用錯誤事件來追蹤錯誤。它會傳回包含完整詳細資訊的 Error 物件。
由於連線已從 v15 開始被棄用,如果您使用的是最新版本,也可以使用它