Skip to content

Commit

Permalink
Change error JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Heckel committed Dec 25, 2021
1 parent 7a23779 commit eeb378c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Server struct {
// errHTTP is a generic HTTP error for any non-200 HTTP error
type errHTTP struct {
Code int `json:"code,omitempty"`
HTTPCode int `json:"http_code"`
HTTPCode int `json:"http"`
Message string `json:"error"`
Link string `json:"link,omitempty"`
}
Expand Down Expand Up @@ -111,7 +111,7 @@ var (
docsStaticFs embed.FS
docsStaticCached = &util.CachingEmbedFS{ModTime: time.Now(), FS: docsStaticFs}

errHTTPNotFound = &errHTTP{40401, http.StatusNotFound, http.StatusText(http.StatusNotFound), ""}
errHTTPNotFound = &errHTTP{40401, http.StatusNotFound, "page not found", ""}
errHTTPTooManyRequestsLimitRequests = &errHTTP{42901, http.StatusTooManyRequests, "limit reached: too many requests, please be nice", "https://ntfy.sh/docs/publish/#limitations"}
errHTTPTooManyRequestsLimitEmails = &errHTTP{42902, http.StatusTooManyRequests, "limit reached: too many emails, please be nice", "https://ntfy.sh/docs/publish/#limitations"}
errHTTPTooManyRequestsLimitSubscriptions = &errHTTP{42903, http.StatusTooManyRequests, "limit reached: too many active subscriptions, please be nice", "https://ntfy.sh/docs/publish/#limitations"}
Expand Down

0 comments on commit eeb378c

Please sign in to comment.