rhbz874983 - give meaningful error message on 503 #3
Conversation
|
Zanata » zanata-client #64 FAILURE |
|
Zanata » zanata-client #66 FAILURE |
|
Zanata » zanata-client #67 FAILURE |
| @@ -82,6 +82,9 @@ public ZanataProxyFactory(URI base, String username, String apiKey, | |||
| // unauthorized | |||
| if (versionResp.getResponseStatus() == Response.Status.UNAUTHORIZED) { | |||
| throw new RuntimeException("Incorrect username/password"); | |||
| } else if (versionResp.getResponseStatus() == Response.Status.SERVICE_UNAVAILABLE) { | |||
| throw new RuntimeException("Service is currently unavailable. " + | |||
| "Please check outage notification or try again later."); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check for any response >= 300, because we won't be able to handle the response. When we try, we get incomprehensible error messages about plaintext/html.
|
Zanata » zanata-client #68 FAILURE |
|
@seanf now it handles other status code |
|
Looks good, thanks. Not sure why Travis and CloudBees are acting up, but the code looks okay to me. |
rhbz874983 - give meaningful error message on 503
Added an in memory HTTP server to return 503 for testing