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

Improve consistency of error handling #172

Merged
merged 1 commit into from Oct 13, 2015
Merged

Improve consistency of error handling #172

merged 1 commit into from Oct 13, 2015

Conversation

njuettner
Copy link

Hi,

I've found another thing, maybe this make sense.

In api/service there some inconsistency to errors. Create function the second error called err2 but in the Put function it's err1. I guess it makes sense to name them both err2.

I'm also wondering why in Create responseError doesn't return the error from errors like in Put or All.

@lclarkmichalek
Copy link
Contributor

I don't actually see the need to define a second error variable in either case. Both times, err will be nil when err1/err2 is written to, so just using err throughout would not cause any problems (and be a lot more idiomatic)

@njuettner
Copy link
Author

You're right, I wasn't quite sure about that. Ok I'll make another proposal for that

@njuettner
Copy link
Author

I've changed it. Could you take a look again?

@lclarkmichalek
Copy link
Contributor

🍤 lgtm. @activars?

@j1n6
Copy link
Contributor

j1n6 commented Oct 13, 2015

lgtm, I do have a branch that refactored this as well. I'm happy to merge this now.

j1n6 pushed a commit that referenced this pull request Oct 13, 2015
Improve consistency of error handling
@j1n6 j1n6 merged commit 7c8ad4a into QubitProducts:master Oct 13, 2015
@njuettner njuettner deleted the feature/service-error branch October 13, 2015 13:52
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.

None yet

3 participants