Comparing version 0.0.20 to 0.0.21
@@ -6,2 +6,3 @@ import { verifyDownload } from "./downloadverify.js"; | ||
import { verifyResolverLinkProofs } from "./skylinkverifyresolver.js"; | ||
import { tryStringify } from "./stringifytry.js"; | ||
// Establish the function that verifies the result is correct. | ||
@@ -20,3 +21,3 @@ // | ||
if (response.status !== 200) { | ||
resolve("unrecognized response status " + response.status.toString() + ", expecting 200"); | ||
resolve("unrecognized response status " + tryStringify(response.status) + ", expecting 200"); | ||
return; | ||
@@ -23,0 +24,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { tryStringify } from "./stringifytry.js"; | ||
// progressiveFetchHelper is the full progressiveFetch function, split out into | ||
@@ -7,3 +8,3 @@ // a helper because the inptus/api is more complicated but only necessary for | ||
if (pfm.remainingPortals.length === 0) { | ||
let newLog = "query failed because all portals have been tried\n" + JSON.stringify(pfm); | ||
let newLog = "query failed because all portals have been tried"; | ||
pfm.logs.push(newLog); | ||
@@ -16,2 +17,3 @@ resolve({ | ||
responsesFailed: pfm.responsesFailed, | ||
messagesFailed: pfm.messagesFailed, | ||
remainingPortals: null, | ||
@@ -52,7 +54,7 @@ logs: pfm.logs, | ||
if (!("status" in response) || typeof response.status !== "number") { | ||
nextPortal(response, "portal has returned invalid response\n" + JSON.stringify({ portal, query })); | ||
nextPortal(response, "portal has returned invalid response\n" + tryStringify({ portal, query })); | ||
return; | ||
} | ||
if (response.status < 200 || response.status >= 300) { | ||
nextPortal(response, "portal has returned error status\n" + JSON.stringify({ portal, query })); | ||
nextPortal(response, "portal has returned error status\n" + tryStringify({ portal, query })); | ||
return; | ||
@@ -81,3 +83,3 @@ } | ||
// This portal failed, try again with the next portal. | ||
nextPortal(null, "fetch returned an error\n" + JSON.stringify(err) + JSON.stringify(pfm.fetchOpts)); | ||
nextPortal(null, "fetch returned an error\n" + tryStringify(err) + tryStringify(pfm.fetchOpts)); | ||
return; | ||
@@ -84,0 +86,0 @@ }); |
{ | ||
"name": "libskynet", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "helper library to interact with skynet's low level primitives", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128320
4106