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

Create JSON error documents for JSON API reverse proxies #11

Open
preaction opened this issue May 27, 2017 · 0 comments
Open

Create JSON error documents for JSON API reverse proxies #11

preaction opened this issue May 27, 2017 · 0 comments

Comments

@preaction
Copy link
Member

When the reverse proxy fails to contact the underlying host, it sends back an error page. This error page defaults to HTML, which is annoying since every other page that could be returned from this site is in JSON.

We should make a 502 error page that returns JSON that looks like the JSON returned by every other error:

{
    "errors": [
        { "message": "Timeout while contacting application server" }
    ]
}

We need to configure Apache to use this error page for the api.cpantesters.org and metabase.cpantesters.org sites (configuration files are in etc/apache2/vhost). The configuration should be sure to send the file with the correct Content-Type header to ensure clients treat it as JSON.

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