Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Nerzal
Copy link
Owner

@Nerzal Nerzal commented Feb 20, 2020

Wrap Errors and use APIError struct to also provide the httpstatus code.

Adresses: #132

@Nerzal
Copy link
Owner Author

Nerzal commented Feb 20, 2020

gnah xD

@Nerzal
Copy link
Owner Author

Nerzal commented Feb 20, 2020

this will most likely result in some merges as soon as i'm finished xD working through 1,4k lines of code :D

@SVilgelm SVilgelm linked an issue Feb 20, 2020 that may be closed by this pull request
@SVilgelm
Copy link
Collaborator

Could be, just restore go.mod and go.sum

@Nerzal
Copy link
Owner Author

Nerzal commented Feb 20, 2020

I'm not quite sure, if we should also pack this

	if resp.StatusCode() == 409 {
		return &ObjectAlreadyExists{ErrorMessage: msg}
	}

into an APIError as it feels like a specific error is better to handle 🤔

@SVilgelm
Copy link
Collaborator

into an APIError as it feels like a specific error is better to handle 🤔

I think we should always return ApiError, we can easy check if status == 409

@Nerzal
Copy link
Owner Author

Nerzal commented Feb 20, 2020

atleast we should treat these changes as breaking changes, when going up with the version, as the some integrations might check for specific error messages and/or the now removed error types.

@Nerzal
Copy link
Owner Author

Nerzal commented Feb 20, 2020

i'll try to fix the failing builds later

@SVilgelm
Copy link
Collaborator

SVilgelm commented Feb 20, 2020

atleast we should treat these changes as breaking changes

sure

@SVilgelm
Copy link
Collaborator

Ok, I see. Please do something with:
actual : "could not get client scope: Code: 404 Message: 404 Not Found: Could not find client scope"
I think it's not good idea to repeat 404 several times

@Nerzal
Copy link
Owner Author

Nerzal commented Feb 20, 2020

true, i'll have a look into it

@Nerzal
Copy link
Owner Author

Nerzal commented Feb 22, 2020

finally (:

@Nerzal Nerzal changed the title [WIP] Error refactoring Error refactoring Feb 22, 2020
Copy link
Collaborator

@SVilgelm SVilgelm left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you

@SVilgelm SVilgelm merged commit 681aed0 into master Feb 22, 2020
@SVilgelm SVilgelm deleted the error_refactoring branch February 22, 2020 22:16
@SVilgelm
Copy link
Collaborator

v5 released!!!!

@SVilgelm
Copy link
Collaborator

oh no

@SVilgelm
Copy link
Collaborator

need to remove v5

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.

Use APIError

3 participants