tsweb: allow HTTPError to unwrap errors
Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
@ -327,6 +327,14 @@ func BenchmarkLog(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPError_Unwrap(t *testing.T) {
|
||||
wrappedErr := fmt.Errorf("wrapped")
|
||||
err := Error(404, "not found", wrappedErr)
|
||||
if got := errors.Unwrap(err); got != wrappedErr {
|
||||
t.Errorf("HTTPError.Unwrap() = %v, want %v", got, wrappedErr)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVarzHandler(t *testing.T) {
|
||||
t.Run("globals_log", func(t *testing.T) {
|
||||
rec := httptest.NewRecorder()
|
||||
|
Reference in New Issue
Block a user