ErrHTTP //
(r *http.Request, msg string, opts ...int)
| 696 | ///////////// |
| 697 | |
| 698 | func NewErrHTTP(r *http.Request, msg string, opts ...int) (e *ErrHTTP) { |
| 699 | var errCode int |
| 700 | if len(opts) > 0 { |
| 701 | errCode = opts[0] |
| 702 | } |
| 703 | e = &ErrHTTP{} |
| 704 | e.init(r, msg, errCode) |
| 705 | return e |
| 706 | } |
| 707 | |
| 708 | func (e *ErrHTTP) init(r *http.Request, msg string, errCode int) { |
| 709 | e.Status = http.StatusBadRequest |
no test coverage detected