summaryrefslogtreecommitdiffhomepage
path: root/tsweb/tsweb_test.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@tailscale.com>2020-09-17 09:56:12 -0400
committerDavid Crawshaw <crawshaw@tailscale.com>2020-09-17 09:57:36 -0400
commitad10cd71a626b005d14bc781e037df18be8128fe (patch)
tree8f3f348be3bab458d3434b87a7c623b21b38be9a /tsweb/tsweb_test.go
parentdea3ef0597d39616276495bab40366cfafc22925 (diff)
downloadtailscale-crawshaw/jsonhandler.tar.xz
tailscale-crawshaw/jsonhandler.zip
tsweb: when unwrapping HTTPError, record the user-facing message also in the logcrawshaw/jsonhandler
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>
Diffstat (limited to 'tsweb/tsweb_test.go')
-rw-r--r--tsweb/tsweb_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/tsweb/tsweb_test.go b/tsweb/tsweb_test.go
index 6b4dcaf28..2e94ef752 100644
--- a/tsweb/tsweb_test.go
+++ b/tsweb/tsweb_test.go
@@ -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,
},
},