{"modulePath":"github.com/segmentfault/pacman","version":"v1.0.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Functions\n\n```go\nfunc IsBadRequest(err *Error) bool\n```\nIsBadRequest determines if err is BadRequest error.\n\n```go\nfunc IsClientClosed(err *Error) bool\n```\nIsClientClosed determines if err is ClientClosed error.\n\n```go\nfunc IsConflict(err *Error) bool\n```\nIsConflict determines if err is Conflict error.\n\n```go\nfunc IsForbidden(err *Error) bool\n```\nIsForbidden determines if err is Forbidden error.\n\n```go\nfunc IsGatewayTimeout(err *Error) bool\n```\nIsGatewayTimeout determines if err is GatewayTimeout error.\n\n```go\nfunc IsInternalServer(err *Error) bool\n```\nIsInternalServer determines if err is InternalServer error.\n\n```go\nfunc IsNotFound(err *Error) bool\n```\nIsNotFound determines if err is NotFound error.\n\n```go\nfunc IsServiceUnavailable(err *Error) bool\n```\nIsServiceUnavailable determines if err is ServiceUnavailable error.\n\n```go\nfunc IsUnauthorized(err *Error) bool\n```\nIsUnauthorized determines if err is Unauthorized error.\n\n```go\nfunc LogStack(start, end int) string\n```\nLogStack return call function stack info from start stack to end stack. if end is a positive number, return all call function stack.\n\n## Types\n\n```go\ntype Error struct {\n\tCode    int\n\tReason  string\n\tMessage string\n\tErr     error\n\tStack   string\n}\n```\nError is error with info\n\n```go\nfunc BadRequest(reason string) *Error\n```\nBadRequest new BadRequest error\n\n```go\nfunc ClientClosed(reason string) *Error\n```\nClientClosed new ClientClosed error\n\n```go\nfunc Conflict(reason string) *Error\n```\nConflict new Conflict error\n\n```go\nfunc Forbidden(reason string) *Error\n```\nForbidden new Forbidden error\n\n```go\nfunc GatewayTimeout(reason string) *Error\n```\nGatewayTimeout new GatewayTimeout error\n\n```go\nfunc InternalServer(reason string) *Error\n```\nInternalServer new InternalServer error\n\n```go\nfunc New(code int, reason string) *Error\n```\nNew create error\n\n```go\nfunc NotFound(reason string) *Error\n```\nNotFound new NotFound error\n\n```go\nfunc ServiceUnavailable(reason string) *Error\n```\nServiceUnavailable new ServiceUnavailable error\n\n```go\nfunc Unauthorized(reason string) *Error\n```\nUnauthorized new Unauthorized error\n\n```go\nfunc (e *Error) Error() string\n```\nError return error with info\n\n```go\nfunc (e *Error) Format(state fmt.State, verb rune)\n```\n\n```go\nfunc (e *Error) WithError(err error) *Error\n```\nWithError with original error\n\n```go\nfunc (e *Error) WithMsg(message string) *Error\n```\nWithMsg with message\n\n```go\nfunc (e *Error) WithStack() *Error\n```\nWithStack with stack\n\n","path":"github.com/segmentfault/pacman/errors","name":"errors","synopsis":"","isRedistributable":true}
