1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 20:17:05 +00:00

replace ioutil with io package and other minor improvements

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-06-17 22:03:18 +03:00
parent 20d2855a66
commit ef2643b046
108 changed files with 1069 additions and 1021 deletions

View File

@@ -56,11 +56,12 @@ var errorCodeMap = make(map[ErrorCodeName]ErrorCode)
// See "RegisterErrorCode" and "RegisterErrorCodeMap" for alternatives.
//
// Example:
// var (
// NotFound = errors.E("NOT_FOUND", http.StatusNotFound)
// )
// ...
// NotFound.Details(ctx, "resource not found", "user with id: %q was not found", userID)
//
// var (
// NotFound = errors.E("NOT_FOUND", http.StatusNotFound)
// )
// ...
// NotFound.Details(ctx, "resource not found", "user with id: %q was not found", userID)
//
// This method MUST be called on initialization, before HTTP server starts as
// the internal map is not protected by mutex.
@@ -238,7 +239,8 @@ var (
// Error represents the JSON form of "http wire errors".
//
// Examples can be found at:
// https://github.com/kataras/iris/tree/master/_examples/routing/http-wire-errors.
//
// https://github.com/kataras/iris/tree/master/_examples/routing/http-wire-errors.
type Error struct {
ErrorCode ErrorCode `json:"http_error_code" yaml:"HTTPErrorCode"`
Message string `json:"message,omitempty" yaml:"Message"`