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

Limited Error information in breeze api #170

Open
sans-sense opened this issue Dec 14, 2024 · 2 comments
Open

Limited Error information in breeze api #170

sans-sense opened this issue Dec 14, 2024 · 2 comments

Comments

@sans-sense
Copy link

in case of api errors like on 14th December, 2024 11:10 a.m when "'https://api.icicidirect.com/breezeapi/api/v1/customerdetails'" was down, the error message reported by

breeze.generate_session(api_secret=<some_secret>,session_token=<some_token>)

is "Invalid JSON format in API response". It may be better to add more error information from the actual response.

Suggested Fix

Declare response as None above try block and use the reponse.text if response is not None in composing the error message in method

Details

Actual error reported by the url https://api.icicidirect.com/breezeapi/api/v1/customerdetails

'\n\n\n<title>Error</title>\n<style>\nhtml { color-scheme: light dark; }\nbody { width: 35em; margin: 0 auto;\nfont-family: Tahoma, Verdana, Arial, sans-serif; }\n</style>\n\n\n

An error occurred.

\n

Sorry, the page you are looking for is currently unavailable.
\nPlease try again later.

\n

If you are the system administrator of this resource then you should check\nthe error log for details.

\n

Faithfully yours, nginx.

\n\n\n'

Additionally the error message is leaking implementation details (like use of nginx) which may be a flag for security team

@Idirect-Tech
Copy link
Owner

Idirect-Tech commented Dec 15, 2024 via email

@sans-sense
Copy link
Author

This issue is about error reporting rather than service disruption. While the API services were restored on Monday (16th dec '24), the error reporting is still the same which may need correcting. If otherwise, please feel free to close the issue.

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