Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return real error instead of a generic "Error forwarding request to origin" #24

Open
simoami opened this issue Jun 6, 2016 · 1 comment

Comments

@simoami
Copy link

simoami commented Jun 6, 2016

The current error makes it difficult to troubleshoot the issue and "throwable" may contain helpful tips on the reason for the failure:

In the 2 occurrences where ERROR_RESPONSE is being used, here's an improved response:

here

if (Strings.isNullOrEmpty(vip)) {
    serverResponse.getHeaders().set("Content-Type", "application/xml");
    serverResponse.writeString("<status><status_code>500</status_code><message>vip not supplied</message></status>");
    logger.error("VIP not supplied");
    return serverResponse.close();
}

and here

public Observable<Void> call(Throwable throwable) {
    serverResponse.getHeaders().set("Content-Type", "application/xml");
    String msg = "<status><status_code>500</status_code><message>" + throwable.getMessage() + "</message></status>";
    serverResponse.writeString(msg);
    return Observable.just(null);
}
@simoami
Copy link
Author

simoami commented Jun 6, 2016

Let me know if I should create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant