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 support for a "debug" mode, or just make error handling more robust #234

Open
ralexstokes opened this issue Aug 8, 2023 · 0 comments

Comments

@ralexstokes
Copy link
Owner

one thing I have noticed while using the Client type is that failures are annoying to diagnose

the API is strongly-typed and so if URL endpoints and message types are correct, things work well

if they aren't, it is usually hard to know what went wrong

options:

  • add some type of "debug" flag inside the Client that exposes the information we need (e.g. which endpoint, what does the HTTP message look like as text, what does the response look like as text)
  • more tolerant response parsing (e.g. try to parse within the realm we expect but if that fails, then make an Error variant that dumps the response status code and body (if any))

this last route actually sounds better (even if ultimately we do need the former)

@ralexstokes ralexstokes changed the title add support for a "debug" mode add support for a "debug" mode, or just make error handling more robust Aug 8, 2023
@ralexstokes ralexstokes transferred this issue from ralexstokes/beacon-api-client Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant