{"modulePath":"github.com/micro/go-micro","version":"v0.0.0-20200130103340-2b1e0a6fd672","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\nPackage errors provides a way to return detailed information for an RPC request error. The error is normally JSON encoded.\n\n## Functions\n\n```go\nfunc BadRequest(id, format string, a ...interface{}) error\n```\nBadRequest generates a 400 error.\n\n```go\nfunc Conflict(id, format string, a ...interface{}) error\n```\nConflict generates a 409 error.\n\n```go\nfunc Forbidden(id, format string, a ...interface{}) error\n```\nForbidden generates a 403 error.\n\n```go\nfunc InternalServerError(id, format string, a ...interface{}) error\n```\nInternalServerError generates a 500 error.\n\n```go\nfunc MethodNotAllowed(id, format string, a ...interface{}) error\n```\nMethodNotAllowed generates a 405 error.\n\n```go\nfunc New(id, detail string, code int32) error\n```\nNew generates a custom error.\n\n```go\nfunc NotFound(id, format string, a ...interface{}) error\n```\nNotFound generates a 404 error.\n\n```go\nfunc Timeout(id, format string, a ...interface{}) error\n```\nTimeout generates a 408 error.\n\n```go\nfunc Unauthorized(id, format string, a ...interface{}) error\n```\nUnauthorized generates a 401 error.\n\n## Types\n\n```go\ntype Error struct {\n\tId     string `json:\"id\"`\n\tCode   int32  `json:\"code\"`\n\tDetail string `json:\"detail\"`\n\tStatus string `json:\"status\"`\n}\n```\nError implements the error interface.\n\n```go\nfunc Parse(err string) *Error\n```\nParse tries to parse a JSON string into an error. If that fails, it will set the given string as the error detail.\n\n```go\nfunc (e *Error) Error() string\n```\n\n","path":"github.com/micro/go-micro/errors","name":"errors","synopsis":"Package errors provides a way to return detailed information for an RPC request error.","isRedistributable":true}
