syndesisio / syndesis-rest

The API for Syndesis - a flexible, customizable, cloud-hosted platform that provides core integration capabilities as a service. It leverages Red Hat's existing product architecture using OpenShift Online/Dedicated and Fuse Integration Services.
https://syndesis-staging.b6ff.rh-idev.openshiftapps.com/api/v1/
Apache License 2.0
6 stars 17 forks source link

Upstream system errors get hidden via a generic error #652

Closed gashcrumb closed 7 years ago

gashcrumb commented 7 years ago

Working on getting a twitter connection created, when I click the 'Connect Twitter' button nothing happens (need to fix the page error handling :-). While investigating I see that the call to /credentials fails like:

{"errorCode":500,"userMsg":"Please contact the administrator and file a bug report","developerMsg":"Internal Server Exception. 401 Authorization Required"}

Which I definitely need to show in the UI. However it's not a lot of information to tell what's going wrong. If I look at what's logged in the rest api pod however, the problem is a lot more apparent:

2017-09-29 15:18:45.965 ERROR [-,1f95988decdd0a3c,1f95988decdd0a3c,false] 1 --- [ XNIO-3 task-10] o.s.social.support.LoggingErrorHandler   : Response body: <?xml version="1.0" encoding="UTF-8"?><hash>  <error>This client application's callback url has been locked</error>  <request>/oauth/request_token</request></hash>
2017-09-29 15:18:45.966 ERROR [-,1f95988decdd0a3c,1f95988decdd0a3c,false] 1 --- [ XNIO-3 task-10] .s.r.v.h.e.SyndesisServerExceptionMapper : Internal Server Exception. 401 Authorization Required
 

Which is a lot more informative. We should figure out how to pass on error response bodies from upstream systems rather than exposing errors as a fairly generic internal server exception, as we can then show much more meaningful error messages to the user without requiring investigation.

KurtStam commented 7 years ago

This is probably going to be fixed by the same fix as for https://github.com/syndesisio/syndesis-rest/issues/679

rhuss commented 7 years ago

Is this then fixed also with #709 ?

zregvart commented 7 years ago

Is this then fixed also with #709 ?

I think so, yes.