diff options
author | 2023-05-12 08:16:41 +0000 | |
---|---|---|
committer | 2023-05-12 10:16:41 +0200 | |
commit | ba5a464ca5d3fcbd171c174a4f07c3326ecb01df (patch) | |
tree | 4289873a2fef9a9b102fb692b0cf6d3409a41747 /internal/web/confirmemail.go | |
parent | use more semantic headers for profile page (#1765) (diff) | |
download | gotosocial-ba5a464ca5d3fcbd171c174a4f07c3326ecb01df.tar.xz |
[chore] Prefer JSON errors in API endpoints (#1766)
* Default to JSON over HTML for error handling
* Change the default error display for web endpoints to html
Diffstat (limited to 'internal/web/confirmemail.go')
-rw-r--r-- | internal/web/confirmemail.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/web/confirmemail.go b/internal/web/confirmemail.go index 069640ccd..b0ece58cd 100644 --- a/internal/web/confirmemail.go +++ b/internal/web/confirmemail.go @@ -32,19 +32,19 @@ func (m *Module) confirmEmailGETHandler(c *gin.Context) { // if there's no token in the query, just serve the 404 web handler token := c.Query(tokenParam) if token == "" { - apiutil.ErrorHandler(c, gtserror.NewErrorNotFound(errors.New(http.StatusText(http.StatusNotFound))), m.processor.InstanceGetV1) + apiutil.WebErrorHandler(c, gtserror.NewErrorNotFound(errors.New(http.StatusText(http.StatusNotFound))), m.processor.InstanceGetV1) return } user, errWithCode := m.processor.User().EmailConfirm(ctx, token) if errWithCode != nil { - apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + apiutil.WebErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } instance, err := m.processor.InstanceGetV1(ctx) if err != nil { - apiutil.ErrorHandler(c, gtserror.NewErrorInternalError(err), m.processor.InstanceGetV1) + apiutil.WebErrorHandler(c, gtserror.NewErrorInternalError(err), m.processor.InstanceGetV1) return } |