GoBroke/tunnelbroker/funcs_httperror.go

17 lines
234 B
Go
Raw Normal View History

package tunnelbroker
import (
`fmt`
)
// Error conforms an HTTPError to an error.
func (h *HTTPError) Error() (errMsg string) {
errMsg = h.CodeStr
if h.Message != nil {
errMsg += fmt.Sprintf(":\n%s", *h.Message)
}
return
}