mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-08 09:07:44 +00:00
tsweb: add a test case for nil child errors in tsweb.Error.
Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
parent
2c2dff9559
commit
5d995d9d6b
@ -121,6 +121,22 @@ func TestStdHandler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "handler returns 404 with nil child error",
|
||||||
|
h: handlerErr(0, Error(404, "not found", nil)),
|
||||||
|
r: req(bgCtx, "http://example.com/foo"),
|
||||||
|
wantCode: 404,
|
||||||
|
wantLog: AccessLogRecord{
|
||||||
|
When: clock.Start,
|
||||||
|
Seconds: 1.0,
|
||||||
|
Proto: "HTTP/1.1",
|
||||||
|
Host: "example.com",
|
||||||
|
Method: "GET",
|
||||||
|
RequestURI: "/foo",
|
||||||
|
Code: 404,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "handler returns generic error",
|
name: "handler returns generic error",
|
||||||
h: handlerErr(0, testErr),
|
h: handlerErr(0, testErr),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user