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 HTTP status code field into APIError struct #14

Merged
merged 2 commits into from
Apr 1, 2020
Merged

Add HTTP status code field into APIError struct #14

merged 2 commits into from
Apr 1, 2020

Conversation

srydai4hmt
Copy link
Contributor

Hello.

Currently, if an error occurs in http get, http status code cannot be retrieved.
I submit this PR in order to get http status code.

Thanks.

@moznion moznion requested review from moznion and bearmini March 29, 2020 09:57
Copy link
Contributor

@bearmini bearmini left a comment

Choose a reason for hiding this comment

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

Hi, thank you for this pull request!

The ErrorCode field in APIError is for Soracom specific 7 characters error code (e.g. ABC1234), this is used to know which component in Soracom platform returned the error and to identify what kind of error occurred by our engineers as described in https://developers.soracom.io/en/docs/tools/api-reference/

Existing SDK users may be using the field, so this pull request cannot be accepted as-is.

Alternatively, can you please modify this to add a field such as HTTPStatusCode into APIError struct and use it to avoid breaking change?

Thank you,

@moznion
Copy link
Contributor

moznion commented Mar 31, 2020

Thank you for your contribution 🙏

I suppose this should be our platform API issue. An API (e.g. GetGroup you pointed out in a test case) has to return an error code if the result was a failure, but some APIs didn't act like that.

Our team found the causes and has fixed a few APIs to return the error code correctly, so I deem maybe the changes in this pull-request are no longer needed.

Could you try it with the current API, @nigamishibumi?
And please feel free to ask us when you were faced something trouble.

@srydai4hmt
Copy link
Contributor Author

@bearmini @moznion
Thank you for your review 😄
I’m going to add a HTTPStatusCode into APIError.

@srydai4hmt
Copy link
Contributor Author

@bearmini @moznion

Fixed breaking changes.
Please check on that.

Copy link
Contributor

@bearmini bearmini left a comment

Choose a reason for hiding this comment

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

👍

Thank you for your contribution!

@bearmini bearmini merged commit 79b9c72 into soracom:master Apr 1, 2020
@moznion moznion changed the title enable to get status code when http get error occurs Add HTTP status code field into APIError struct Apr 1, 2020
@srydai4hmt srydai4hmt deleted the feature/return-http-status-code branch April 1, 2020 11:13
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.

3 participants