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

Add more information to exceptions #31

Open
kpritam opened this issue Jul 11, 2022 · 2 comments · May be fixed by #39
Open

Add more information to exceptions #31

kpritam opened this issue Jul 11, 2022 · 2 comments · May be fixed by #39

Comments

@kpritam
Copy link

kpritam commented Jul 11, 2022

Currently all the failures returns exceptions like InputException, KiteException etc.
but they do not contain detailed error message that is coming from zerodha's rest API, for example, Markets are closed ....

This information is present in the mesasge field in the http response. It would be good if this message can be extracted and put it in the exception.

@kssujithcj
Copy link
Collaborator

We already do that. You just need to access it as kiteException.message

@kpritam
Copy link
Author

kpritam commented Jul 15, 2022

Hi @kssujithcj , thanks for confirming. It does carry exception message.

But it would be good if KiteException constructor calls super(message) so that consumers of this library does not need to type check and extract exception message. This is also a common practice.

Instead of this:

  // constructor that sets the message
    public KiteException(String message){
        this.message = message;
    }

this:

  // constructor that sets the message
    public KiteException(String message){
        this.message = message;
        super(message)
    }

@adrianviegas adrianviegas linked a pull request Oct 24, 2023 that will close this 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

Successfully merging a pull request may close this issue.

2 participants