Documentation
¶
Overview ¶
Package errcat holds the canonical catalogue of reserved HTTP error categories. It is a leaf below the parser (which rejects an unknown category), codegen (which emits each category's HTTP status + default message), and the LSP (which validates and offers them as completions), so a new category is added in exactly ONE place instead of four. Source: the project README §"Error categories".
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Categories = []Category{
{"BadRequest", 400, "Bad request"},
{"Unauthorized", 401, "Unauthorized"},
{"PaymentRequired", 402, "Payment required"},
{"Forbidden", 403, "Forbidden"},
{"NotFound", 404, "Not found"},
{"MethodNotAllowed", 405, "Method not allowed"},
{"NotAcceptable", 406, "Not acceptable"},
{"Conflict", 409, "Conflict"},
{"Gone", 410, "Resource gone"},
{"LengthRequired", 411, "Length required"},
{"PreconditionFailed", 412, "Precondition failed"},
{"PayloadTooLarge", 413, "Payload too large"},
{"UnsupportedMediaType", 415, "Unsupported media type"},
{"UnprocessableEntity", 422, "Unprocessable entity"},
{"Locked", 423, "Resource locked"},
{"TooManyRequests", 429, "Too many requests"},
{"Internal", 500, "Internal server error"},
{"NotImplemented", 501, "Not implemented"},
{"BadGateway", 502, "Bad gateway"},
{"ServiceUnavailable", 503, "Service unavailable"},
{"GatewayTimeout", 504, "Gateway timeout"},
}
Categories is the canonical catalogue in status order. The LSP renders `error <cursor>` completions in this order.
Functions ¶
func IsCategory ¶
IsCategory reports whether name is a reserved error category.
Types ¶
Click to show internal directories.
Click to hide internal directories.