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

feat: Expose structured API response errors #531

Merged
merged 9 commits into from
Oct 1, 2024
Merged

Conversation

nieomylnieja
Copy link
Collaborator

@nieomylnieja nieomylnieja commented Aug 30, 2024

Motivation

sdk.Client methods which interact with Nobl9 API currently return only generic text based errors.
This obstructs the relevant details from the user. Furthermore, the current default text format for these errors is fairly poor and doesn't contain details like endpoint path.

Summary

  • Added sdk.APIError which is a structured error that contains all the relevant API error details as well as produces an improved (over the previous state) text representation.
  • Improved docs.
  • Removed PlantUML in favour of Mermaid, since it's much easier to use as it doesn't require Java and renders natively in Markdown.

Testing

Covered by both unit and end-to-end tests.

Release Notes

sdk.Client API calls now can return sdk.APIError, which is a structured error providing details of the error returned by Nobl9's API.

@nieomylnieja nieomylnieja changed the title feat: Expose structured HTTP response errors feat: Expose structured API response errors Aug 30, 2024
@n9-machine-user n9-machine-user added enhancement New feature or request go minor labels Aug 30, 2024
sdk/client_errors.go Outdated Show resolved Hide resolved
Copy link
Member

@skrolikiewicz skrolikiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@nieomylnieja nieomylnieja enabled auto-merge (squash) October 1, 2024 11:50
@nieomylnieja nieomylnieja merged commit 45a5c1c into main Oct 1, 2024
5 checks passed
@nieomylnieja nieomylnieja deleted the improve-http-errors branch October 1, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants