Documentation ¶
Index ¶
- Constants
- func WithMessage(err error, msg string) error
- func WithStack(err error) error
- func Wrap(err error, msg string) error
- type Problem
- func (p Problem) Cause() error
- func (p Problem) Error() string
- func (p Problem) Format(s fmt.State, verb rune)
- func (p Problem) SetDetail(detail string) *Problem
- func (p Problem) SetInstance(instance string) *Problem
- func (p Problem) SetStatus(status int) *Problem
- func (p Problem) SetTitle(title string) *Problem
- func (p Problem) SetType(t string) *Problem
Constants ¶
View Source
const DefaultType = "about:blank"
DefaultType implements the default type content described in RFC 7807
Variables ¶
This section is empty.
Functions ¶
func WithMessage ¶
WithMessage is an alias to github.com/pkg/errors WithMessage function. If Problem pointer passed as error, it sets the error, stacktrace and message of Problem.
Types ¶
type Problem ¶
type Problem struct { Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Type string `json:"type"` Instance string `json:"instance,omitempty"` Status int `json:"status,omitempty"` // contains filtered or unexported fields }
Problem implements the RFC 7807 "problem"/error standard Additional error field can be defined in custom struct implementing the Problem struct
func (Problem) SetInstance ¶
SetInstance sets the instance field of the problem, specified in RFC 7807
Click to show internal directories.
Click to hide internal directories.