amadeus-node icon indicating copy to clipboard operation
amadeus-node copied to clipboard

It does log error message in console even the API call finishes with success status code.

Open harishsharma29 opened this issue 2 years ago • 1 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/amadeus/lib/amadeus/client/listener.js b/node_modules/amadeus/lib/amadeus/client/listener.js
index ea05aa6..e49953f 100644
--- a/node_modules/amadeus/lib/amadeus/client/listener.js
+++ b/node_modules/amadeus/lib/amadeus/client/listener.js
@@ -48,7 +48,6 @@ var Listener = /*#__PURE__*/function () {
       var response = new _response["default"](http_response, this.request);
       http_response.on('data', response.addChunk.bind(response));
       http_response.on('end', this.onEnd(response).bind(this));
-      http_response.on('close', this.onNetworkError(response).bind(this));
       http_response.on('error', this.onNetworkError(response).bind(this));
     }
 

This issue body was partially generated by patch-package.

harishsharma29 avatar Dec 30 '23 08:12 harishsharma29

Hello @harishsharma29 , Thank you for your PR!

However we want to keep the potential network errors logs in case any. Can you share what was the reason that you don't want to see the log and any other suggestion?

minjikarin avatar Feb 09 '24 13:02 minjikarin