Skip to content

Conversation

@davispuh
Copy link
Contributor

@davispuh davispuh commented Aug 9, 2024

Implement json error pages.
This is useful when JSON backend/API doesn't have nice error info and might return blank page.

To use with Nginx:

map $http_accept $errorExtension
{
    default                    html;
    ~application/json          json;
    ~application/activity+json json;
}


error_page 400 /ErrorPages/HTTP400.$errorExtension;
error_page 401 /ErrorPages/HTTP401.$errorExtension;
error_page 403 /ErrorPages/HTTP403.$errorExtension;
# ...

This will cause that when client has Accept: application/json header then it will get JSON response.

@davispuh
Copy link
Contributor Author

Ping? Could you merge my PRs?

@davispuh
Copy link
Contributor Author

What about this one?

@AndiDittrich
Copy link
Member

tldr: technically out of scope

@davispuh
Copy link
Contributor Author

How so? I need a solution to handle all error pages even for JSON APIs and this looks like best tool. It doesn't make sense to have separate tool just for JSON when this could do it all.

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

Successfully merging this pull request may close these issues.

2 participants