fabric8-services / fabric8-wit

wit stands for Work Item Tracker
http://devdoc.almighty.io/
Apache License 2.0
45 stars 86 forks source link

Improve error messages for service responses. #1010

Open sbose78 opened 7 years ago

sbose78 commented 7 years ago

When I run my tests for #1007 the following error doesn't say anything meaningful-

--- FAIL: TestListUsersOK (0.02s)
    users_testing.go:212: invalid response status code: got 500, expected 200
    users_testing.go:219: invalid response media: got &{Errors:[0xc420a4bef0]}, expected instance of app.UserArray

this comes from

https://github.com/almighty/almighty-core/blob/master/controller/users.go#L128

return jsonapi.JSONErrorResponse(ctx, errors.Wrap(err, "Error listing users"))

We need to improve this..

hectorj2f commented 7 years ago

+1

alexeykazakov commented 7 years ago

We need to refactor List Users. But there is another issue about this. So, this should be a part of that refactoring ;)

aslakknutsen commented 7 years ago

But what does the List Users have to do with this per say? The errors are saying; an internal error happened, but the object that was received is Errors:[pointer to error] and not an app.UserArray as expected. This is coming from the Goa generated test code. The fix here must be to improve the String()/Error() method of the JSONError class, not the List User function.