Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
harishsharma29 opened this issue Dec 30, 2023 · 1 comment

Comments

@harishsharma29
Copy link

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.

@minjikarin
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants