Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): added exit code in templates in case of script failure #240

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion data/project-templates/js-node-esm/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ import { GolemNetwork } from "@golem-sdk/golem-js";
.catch((err) => console.error(`Something went wrong:`, err));
} catch (err) {
console.error("Something went wrong:", err);
throw err;
} finally {
// Disconnect from the Golem Network.
// This will clear the rental pools and finalize and pay all rentals that were created within the Golem Network
await glm.disconnect();
}
})().catch(console.error);
})().catch((error) => {
console.error(error);
process.exit(1);
});
6 changes: 5 additions & 1 deletion data/project-templates/js-node/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ const { GolemNetwork } = require("@golem-sdk/golem-js");
.catch((err) => console.error(`Something went wrong:`, err));
} catch (err) {
console.error("Something went wrong:", err);
throw err;
} finally {
// Disconnect from the Golem Network.
// This will clear the rental pools and finalize and pay all rentals that were created within the Golem Network
await glm.disconnect();
}
})().catch(console.error);
})().catch((error) => {
console.error(error);
process.exit(1);
});
6 changes: 5 additions & 1 deletion data/project-templates/ts-node-esm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ import { GolemNetwork, MarketOrderSpec } from "@golem-sdk/golem-js";
.catch((err) => console.error(`Something went wrong:`, err));
} catch (err) {
console.error("Something went wrong:", err);
throw err;
} finally {
// Disconnect from the Golem Network.
// This will clear the rental pools and finalize and pay all rentals that were created within the Golem Network
await glm.disconnect();
}
})().catch(console.error);
})().catch((error) => {
console.error(error);
process.exit(1);
});
6 changes: 5 additions & 1 deletion data/project-templates/ts-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ import { GolemNetwork, MarketOrderSpec } from "@golem-sdk/golem-js";
.catch((err) => console.error(`Something went wrong:`, err));
} catch (err) {
console.error("Something went wrong:", err);
throw err;
} finally {
// Disconnect from the Golem Network.
// This will clear the rental pools and finalize and pay all rentals that were created within the Golem Network
await glm.disconnect();
}
})().catch(console.error);
})().catch((error) => {
console.error(error);
process.exit(1);
});
Loading