diff --git a/dist/index.js b/dist/index.js index aacded5..597aca5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -15323,26 +15323,30 @@ async function attachToTangle(provider, depth, mwm, seed, addressIndex, tag, pay const message = asciiToTrytes(ascii); console.log(`Message Trytes Length: ${message.length}`); - const iota = composeAPI({ - provider - }); - - const address = generateAddress(seed, addressIndex); + try { + const iota = composeAPI({ + provider + }); - console.log("Preparing transfer"); - const trytes = await iota.prepareTransfers('9'.repeat(81), [ - { - address, - value: 0, - message, - tag - } - ]); + const address = generateAddress(seed, addressIndex); - console.log("Sending trytes"); - const bundles = await iota.sendTrytes(trytes, depth, mwm); + console.log("Preparing transfer"); + const trytes = await iota.prepareTransfers('9'.repeat(81), [ + { + address, + value: 0, + message, + tag + } + ]); - return bundles[0].hash; + console.log("Sending trytes"); + const bundles = await iota.sendTrytes(trytes, depth, mwm); + return bundles[0].hash; + } catch (err) { + console.log(`Sending trytes failed`); + console.log(err.message); + } } module.exports = { @@ -31946,7 +31950,7 @@ async function run() { } catch (error) { core.setFailed(error.message); console.log(`Failed`); - console.log(error.message); + console.log(error); } } diff --git a/package.json b/package.json index 34298de..ffb249e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gh-tangle-release", - "version": "0.5.3", + "version": "0.5.4", "description": "Create a release and adds metadata to the IOTA Tangle", "main": "dist/index.js", "scripts": { diff --git a/src/iota.js b/src/iota.js index d91a6ba..ff9a5bd 100644 --- a/src/iota.js +++ b/src/iota.js @@ -13,26 +13,30 @@ async function attachToTangle(provider, depth, mwm, seed, addressIndex, tag, pay const message = asciiToTrytes(ascii); console.log(`Message Trytes Length: ${message.length}`); - const iota = composeAPI({ - provider - }); - - const address = generateAddress(seed, addressIndex); - - console.log("Preparing transfer"); - const trytes = await iota.prepareTransfers('9'.repeat(81), [ - { - address, - value: 0, - message, - tag - } - ]); - - console.log("Sending trytes"); - const bundles = await iota.sendTrytes(trytes, depth, mwm); - - return bundles[0].hash; + try { + const iota = composeAPI({ + provider + }); + + const address = generateAddress(seed, addressIndex); + + console.log("Preparing transfer"); + const trytes = await iota.prepareTransfers('9'.repeat(81), [ + { + address, + value: 0, + message, + tag + } + ]); + + console.log("Sending trytes"); + const bundles = await iota.sendTrytes(trytes, depth, mwm); + return bundles[0].hash; + } catch (err) { + console.log(`Sending trytes failed`); + console.log(err.message); + } } module.exports = { diff --git a/src/tangle-release.js b/src/tangle-release.js index eb2d4bc..e71cd72 100644 --- a/src/tangle-release.js +++ b/src/tangle-release.js @@ -98,7 +98,7 @@ async function run() { } catch (error) { core.setFailed(error.message); console.log(`Failed`); - console.log(error.message); + console.log(error); } }