QubitProducts / bamboo

HAProxy auto configuration and auto service discovery for Mesos Marathon
Apache License 2.0
793 stars 214 forks source link

Improve consistency of error handling #172

Closed njuettner closed 8 years ago

njuettner commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

njuettner commented 8 years ago

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

lclarkmichalek commented 8 years ago

:fried_shrimp: lgtm. @activars?

j1n6 commented 8 years ago

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