Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

rhbz874983 - give meaningful error message on 503 #3

Merged
merged 5 commits into from Nov 13, 2013

Conversation

huangp
Copy link
Collaborator

@huangp huangp commented Nov 13, 2013

Added an in memory HTTP server to return 503 for testing

@buildhive
Copy link

Zanata » zanata-client #64 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive
Copy link

Zanata » zanata-client #66 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive
Copy link

Zanata » zanata-client #67 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@@ -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.");
Copy link
Contributor

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.

@buildhive
Copy link

Zanata » zanata-client #68 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@huangp
Copy link
Collaborator Author

huangp commented Nov 13, 2013

@seanf now it handles other status code

@seanf
Copy link
Contributor

seanf commented Nov 13, 2013

Looks good, thanks.

Not sure why Travis and CloudBees are acting up, but the code looks okay to me.

seanf added a commit that referenced this pull request Nov 13, 2013
rhbz874983 - give meaningful error message on 503
@seanf seanf merged commit 7fd1026 into integration/master Nov 13, 2013
@seanf seanf deleted the rhbz874983 branch November 13, 2013 23:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants