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

[feature] API error handling #637

Merged
merged 22 commits into from
Jun 8, 2022
Merged

[feature] API error handling #637

merged 22 commits into from
Jun 8, 2022

Conversation

tsmethurst
Copy link
Contributor

This PR reworks almost all of the client and s2s api endpoints to provide better more consistent and informative error handling, as well as a few other little fixups.

Main changes:

  1. Allow serving html errors if that's the client's preference -- very nice for 404 statuses etc, and closes [security] Make sure 404s from invisible statuses and 404s from bad routes are identical #58
  2. Debug log non-200 codes passed through the new error handler in a consistent way; error log internal server errors.
  3. Make a few remaining processor functions return gtserror.WithCode for more granular error handling.
  4. Make the 404 page more informative for users so they don't get puzzled about why they can't see certain things.
  5. Redirect html requests to AP user URIs to that user's profile or the relevant status instead.
  6. Lots of other little tidies up.

@tsmethurst tsmethurst merged commit 1ede54d into main Jun 8, 2022
@tsmethurst tsmethurst deleted the api_error_handling branch June 8, 2022 18:38
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.

[security] Make sure 404s from invisible statuses and 404s from bad routes are identical
1 participant