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

Better errors for invalid manager actions #46

Open
daleal opened this issue Dec 16, 2021 · 1 comment
Open

Better errors for invalid manager actions #46

daleal opened this issue Dec 16, 2021 · 1 comment
Assignees

Comments

@daleal
Copy link
Member

daleal commented Dec 16, 2021

Right now, when a user tries to use an invalid action on a manager, the error returned is really bad (basically, there is no checking for invalid actions). For example, trying to get an invoice returns the following error:

Traceback (most recent call last):
  File "dist/main.py", line 16, in <module>
    invoice = link.invoices.get("inv_e7Qn499tZ6x14BW3")
  File "/home/epsilon/documents/work/fintoc/fintoc-python/fintoc/utils.py", line 71, in wrapper
    raise error(error_data["error"]) from None
fintoc.errors.InvalidRequestError: invalid_request_error: unrecognized_request
Unrecognized request: GET /v1/invoices/inv_e7Qn499tZ6x14BW3?link_token=link_5Vw1GBZiRaxGpORl_token_4aTYpCwxKRKcAntvHqHe4mTx. Please see https://docs.fintoc.com/ for valid routes.

This might be because the action validation is done through a __getattr__. The SDK should probably work similar to how the Node SDK works (have a method for each action and check on that method).

@daleal daleal self-assigned this Dec 16, 2021
@joanEstrada
Copy link

Is this issue solved?

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