// errHTTP is a generic HTTP error for any non-200 HTTP error
typeerrHTTPstruct{
Codeint`json:"code,omitempty"`
HTTPCodeint`json:"http"`
Messagestring`json:"error"`
Linkstring`json:"link,omitempty"`
}
func(eerrHTTP)Error()string{
returne.Message
}
func(eerrHTTP)JSON()string{
b,_:=json.Marshal(&e)
returnstring(b)
}
var(
errHTTPBadRequestEmailDisabled=&errHTTP{40001,http.StatusBadRequest,"e-mail notifications are not enabled","https://ntfy.sh/docs/config/#e-mail-notifications"}
errHTTPBadRequestDelayNoCache=&errHTTP{40002,http.StatusBadRequest,"cannot disable cache for delayed message",""}
errHTTPBadRequestDelayNoEmail=&errHTTP{40003,http.StatusBadRequest,"delayed e-mail notifications are not supported",""}
errHTTPBadRequestDelayCannotParse=&errHTTP{40004,http.StatusBadRequest,"invalid delay parameter: unable to parse delay","https://ntfy.sh/docs/publish/#scheduled-delivery"}
errHTTPBadRequestDelayTooSmall=&errHTTP{40005,http.StatusBadRequest,"invalid delay parameter: too small, please refer to the docs","https://ntfy.sh/docs/publish/#scheduled-delivery"}
errHTTPBadRequestDelayTooLarge=&errHTTP{40006,http.StatusBadRequest,"invalid delay parameter: too large, please refer to the docs","https://ntfy.sh/docs/publish/#scheduled-delivery"}
errHTTPBadRequestSinceInvalid=&errHTTP{40008,http.StatusBadRequest,"invalid since parameter","https://ntfy.sh/docs/subscribe/api/#fetch-cached-messages"}
errHTTPBadRequestAttachmentURLInvalid=&errHTTP{40013,http.StatusBadRequest,"invalid request: attachment URL is invalid","https://ntfy.sh/docs/publish/#attachments"}
errHTTPBadRequestAttachmentsDisallowed=&errHTTP{40014,http.StatusBadRequest,"invalid request: attachments not allowed","https://ntfy.sh/docs/config/#attachments"}
errHTTPBadRequestAttachmentsExpiryBeforeDelivery=&errHTTP{40015,http.StatusBadRequest,"invalid request: attachment expiry before delayed delivery date","https://ntfy.sh/docs/publish/#scheduled-delivery"}
errHTTPBadRequestWebSocketsUpgradeHeaderMissing=&errHTTP{40016,http.StatusBadRequest,"invalid request: client not using the websocket protocol","https://ntfy.sh/docs/subscribe/api/#websockets"}
errHTTPBadRequestJSONInvalid=&errHTTP{40017,http.StatusBadRequest,"invalid request: request body must be message JSON","https://ntfy.sh/docs/publish/#publish-as-json"}
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"}
errHTTPTooManyRequestsLimitTotalTopics=&errHTTP{42904,http.StatusTooManyRequests,"limit reached: the total number of topics on the server has been reached, please contact the admin","https://ntfy.sh/docs/publish/#limitations"}
errHTTPTooManyRequestsAttachmentBandwidthLimit=&errHTTP{42905,http.StatusTooManyRequests,"too many requests: daily bandwidth limit reached","https://ntfy.sh/docs/publish/#limitations"}
errHTTPInternalError=&errHTTP{50001,http.StatusInternalServerError,"internal server error",""}
errHTTPInternalErrorInvalidFilePath=&errHTTP{50002,http.StatusInternalServerError,"internal server error: invalid file path",""}