@dappnode/dappnodesdk
Version:
dappnodesdk is a tool to make the creation of new dappnode packages as simple as possible. It helps to initialize and publish in ethereum blockchain
26 lines • 797 B
JavaScript
import { CliError } from "../../params.js";
import { ReleaseUploaderConnectionError } from "../../releaseUploader/index.js";
export function getVerifyConnectionTask({ releaseUploader, skipUpload }) {
return {
title: "Verify connection",
skip: () => skipUpload,
task: () => verifyConnection(releaseUploader)
};
}
async function verifyConnection(releaseUploader) {
try {
await releaseUploader.testConnection();
}
catch (e) {
handleConnectionError(e);
}
}
function handleConnectionError(e) {
if (e instanceof ReleaseUploaderConnectionError) {
throw new CliError(`Can't connect to ${e.ipfsProvider}: ${e.reason}. ${e.help || ""}`);
}
else {
throw e;
}
}
//# sourceMappingURL=getVerifyConnectionTask.js.map