aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/http/server_test.go
diff options
context:
space:
mode:
authorLewis Marshall <lewis@lmars.net>2017-05-13 08:02:25 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-05-13 08:02:25 +0800
commitb0d0fafd68f526ceed98e59a423b6470f2327a21 (patch)
tree48e0f7286e0b2811e6e1bc5f319abea82012dcee /swarm/api/http/server_test.go
parent90c7155ef41900babc5fd736224127f048e5c883 (diff)
downloaddexon-b0d0fafd68f526ceed98e59a423b6470f2327a21.tar.gz
dexon-b0d0fafd68f526ceed98e59a423b6470f2327a21.tar.zst
dexon-b0d0fafd68f526ceed98e59a423b6470f2327a21.zip
swarm/api: fix error reporting in api.Resolve (#14464)
Previously, resolve errors were being swallowed and the returned error was a generic "not a content hash" which isn't helpful. This updates the Resolve function to fail fast rather than only returning an error at the end, and also adds test coverage.
Diffstat (limited to 'swarm/api/http/server_test.go')
-rw-r--r--swarm/api/http/server_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go
index ceb8db75b..0b124a19a 100644
--- a/swarm/api/http/server_test.go
+++ b/swarm/api/http/server_test.go
@@ -106,9 +106,9 @@ func TestBzzrGetPath(t *testing.T) {
}
nonhashresponses := []string{
- "error resolving name: 'name' does not resolve: no DNS to resolve name but is not a content hash\n",
- "error resolving nonhash: 'nonhash' is not a content hash\n",
- "error resolving nonhash: 'nonhash' does not resolve: no DNS to resolve name but is not a content hash\n",
+ "error resolving name: no DNS to resolve name: \"name\"\n",
+ "error resolving nonhash: immutable address not a content hash: \"nonhash\"\n",
+ "error resolving nonhash: no DNS to resolve name: \"nonhash\"\n",
}
for i, url := range nonhashtests {