tsweb: add a Handler type.
Handler is like http.Handler, but returns errors. ErrHandler converts back to an http.Handler, with added error handling and logging. Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
committed by
Dave Anderson
parent
f8d67bb591
commit
98eceae55e
+3
-1
@@ -43,7 +43,9 @@ func (m Msg) String() string {
|
||||
return strings.TrimRight(buf.String(), "\n")
|
||||
}
|
||||
|
||||
// HTTPError is an error with embedded HTTP response information.
|
||||
// HTTPError is an error with embedded HTTP response information. When
|
||||
// received by an ErrHandler, the Code and Msg are sent to the client,
|
||||
// while Err is logged on the server.
|
||||
type HTTPError struct {
|
||||
Code int
|
||||
Msg string // sent to the end-user
|
||||
|
||||
Reference in New Issue
Block a user