Skip to content

Commit

Permalink
Handle input file errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthonyzou committed Jun 17, 2022
1 parent bf379c3 commit 279b71a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "source-map-unpacker",
"version": "1.5.3",
"version": "1.5.5",
"description": "",
"main": "unmap.js",
"bin": {
Expand Down
7 changes: 6 additions & 1 deletion unmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ const opts = program

fs.readFile(opts.path)
.catch(async (e) => {
console.log("Input file does not exists");
if (e.errno == -13) {
console.log("Insufficient permissions to read the tnput file.");
}
if (e.errno == -2) {
console.log("Input file does not exists.");
}
process.exit(1);
})
.then((js) => {
Expand Down

0 comments on commit 279b71a

Please sign in to comment.