summaryrefslogtreecommitdiff
path: root/internal/web/domain-blocklist.go
diff options
context:
space:
mode:
authorLibravatar Natsu Kagami <natsukagami@gmail.com>2023-05-12 08:16:41 +0000
committerLibravatar GitHub <noreply@github.com>2023-05-12 10:16:41 +0200
commitba5a464ca5d3fcbd171c174a4f07c3326ecb01df (patch)
tree4289873a2fef9a9b102fb692b0cf6d3409a41747 /internal/web/domain-blocklist.go
parentuse more semantic headers for profile page (#1765) (diff)
downloadgotosocial-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/domain-blocklist.go')
-rw-r--r--internal/web/domain-blocklist.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/web/domain-blocklist.go b/internal/web/domain-blocklist.go
index b35944706..8a88a0932 100644
--- a/internal/web/domain-blocklist.go
+++ b/internal/web/domain-blocklist.go
@@ -35,25 +35,25 @@ const (
func (m *Module) domainBlockListGETHandler(c *gin.Context) {
authed, err := oauth.Authed(c, false, false, false, false)
if err != nil {
- apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
+ apiutil.WebErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
return
}
if !config.GetInstanceExposeSuspendedWeb() && (authed.Account == nil || authed.User == nil) {
err := fmt.Errorf("this instance does not expose the list of suspended domains publicly")
- apiutil.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
+ apiutil.WebErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGetV1)
return
}
instance, err := m.processor.InstanceGetV1(c.Request.Context())
if err != nil {
- apiutil.ErrorHandler(c, gtserror.NewErrorInternalError(err), m.processor.InstanceGetV1)
+ apiutil.WebErrorHandler(c, gtserror.NewErrorInternalError(err), m.processor.InstanceGetV1)
return
}
domainBlocks, errWithCode := m.processor.InstancePeersGet(c.Request.Context(), true, false, false)
if errWithCode != nil {
- apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
+ apiutil.WebErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}