tsweb: when unwrapping HTTPError, record the user-facing message also in the log

There's often some useful piece of information in there not already
repeated in the internal error.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw
2020-09-17 09:56:12 -04:00
committed by David Crawshaw
parent dea3ef0597
commit 815bf017fc
3 changed files with 12 additions and 3 deletions

View File

@ -122,7 +122,7 @@ func TestStdHandler(t *testing.T) {
Host: "example.com",
Method: "GET",
RequestURI: "/foo",
Err: testErr.Error(),
Err: "not found: " + testErr.Error(),
Code: 404,
},
},
@ -139,6 +139,7 @@ func TestStdHandler(t *testing.T) {
Host: "example.com",
Method: "GET",
RequestURI: "/foo",
Err: "not found",
Code: 404,
},
},
@ -189,7 +190,7 @@ func TestStdHandler(t *testing.T) {
Host: "example.com",
Method: "GET",
RequestURI: "/foo",
Err: testErr.Error(),
Err: "not found: " + testErr.Error(),
Code: 200,
},
},