Skip to content

Commit 976f7da

Browse files
committed
Add stack trace to error
1 parent d3da9c4 commit 976f7da

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gabble",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"main": "dist/index.js",
55
"type": "module",
66
"author": "Jeswin Kumar<[email protected]>",

src/index.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ const argv = yargs(process.argv.slice(2))
4545
describe: "Ignore compilation errors and move to the next page.",
4646
default: false,
4747
},
48+
debug: {
49+
type: "boolean",
50+
describe: "Print detailed stack trace for errors.",
51+
default: false,
52+
},
4853
})
4954
.parseSync();
5055

@@ -157,7 +162,11 @@ async function run() {
157162
);
158163
}
159164
} catch (ex: any) {
160-
console.log(ex.toString());
165+
if (argv.debug) {
166+
console.error(ex.stack);
167+
} else {
168+
console.log(ex.toString());
169+
}
161170
console.log(`Skipped ${file}.`);
162171
}
163172
}

0 commit comments

Comments
 (0)