diff --git a/src/cli/commands/combine.js b/src/cli/commands/combine.js index 5d498b3..ea2b093 100644 --- a/src/cli/commands/combine.js +++ b/src/cli/commands/combine.js @@ -7,6 +7,13 @@ import {promisify} from "util"; import {Graph} from "../../core/graph"; +// Makes the script crash on unhandled rejections instead of silently +// ignoring them. In the future, promise rejections that are not handled will +// terminate the Node.js process with a non-zero exit code. +process.on("unhandledRejection", (err) => { + throw err; +}); + export default class CombineCommand extends Command { static description = "combine multiple contribution graphs into one big graph"; diff --git a/src/cli/commands/graph.js b/src/cli/commands/graph.js index 149dbe4..ba66ef1 100644 --- a/src/cli/commands/graph.js +++ b/src/cli/commands/graph.js @@ -9,6 +9,13 @@ import {pluginNames} from "../common"; const execDependencyGraph = require("../../tools/execDependencyGraph").default; +// Makes the script crash on unhandled rejections instead of silently +// ignoring them. In the future, promise rejections that are not handled will +// terminate the Node.js process with a non-zero exit code. +process.on("unhandledRejection", (err) => { + throw err; +}); + export default class GraphCommand extends Command { static description = `\ create the contribution graph for a repository diff --git a/src/cli/commands/pluginGraph.js b/src/cli/commands/pluginGraph.js index 2643d27..16a6339 100644 --- a/src/cli/commands/pluginGraph.js +++ b/src/cli/commands/pluginGraph.js @@ -9,6 +9,13 @@ import createGitGraph from "../../plugins/git/cloneGitGraph"; import createGithubGraph from "../../plugins/github/fetchGithubGraph"; import {pluginNames} from "../common"; +// Makes the script crash on unhandled rejections instead of silently +// ignoring them. In the future, promise rejections that are not handled will +// terminate the Node.js process with a non-zero exit code. +process.on("unhandledRejection", (err) => { + throw err; +}); + export default class PluginGraphCommand extends Command { static description = "create the contribution graph for a single plugin";