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

Box exceptions rework according to the reference architecture #753

Merged
merged 8 commits into from
Oct 4, 2021

Conversation

mwwoda
Copy link
Contributor

@mwwoda mwwoda commented Sep 30, 2021

A distinction has been made between errors for coding errors (maybe we can think of a better name(?)), API errors and common errors based on reference architecture. This should make it easier to handle e.g. retries. Also got rid of unnecessary setters.

Also solves SDK-1528. The Error object should always be present in case of an API error (otherwise it's a problem in the API), but just in case, I added a default value for the code and message where necessary.

@mwwoda mwwoda changed the title Box errors rework according to common architecture Box exceptions rework according to the reference architecture Sep 30, 2021
antusus
antusus previously approved these changes Sep 30, 2021
Copy link
Contributor

@antusus antusus left a comment

Choose a reason for hiding this comment

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

I'm not sure about the name. We are mostly using this exception when we are validating user input. So maybe BoxValidationException or BoxInvalidArgumentException, or BoxRuntimeException...

@mwwoda
Copy link
Contributor Author

mwwoda commented Oct 4, 2021

I'm not sure about the name. We are mostly using this exception when we are validating user input. So maybe BoxValidationException or BoxInvalidArgumentException, or BoxRuntimeException...

This is true for the input, but we also throw this exception after the API cal. According to our reference architecture, we should use these exceptions when encoding or decoding an http request. We could also distinguish between Coding and Validation errors, but I'm not sure if there are enough benefits to do this right now.

@mwwoda mwwoda merged commit ab1b253 into main Oct 4, 2021
@mwwoda mwwoda deleted the sdk-1528-box-errors-rework branch October 4, 2021 13:05
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 this pull request may close these issues.

2 participants