Skip to content

Commit c31909f

Browse files
committed
# version 1.5.0:
- error handling for requesting non existing files - tests for proper termination
1 parent 22f186b commit c31909f

File tree

5 files changed

+2330
-1926
lines changed

5 files changed

+2330
-1926
lines changed

errorMsg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports.printErr = (err) => {
22

3-
console.error('Error:')
3+
console.error('Error:', err)
44

55
if ('ENOENT' === err.code && 'open' !== err.syscall) {
66
console.error('Please install graphicsmagick:')
@@ -12,5 +12,5 @@ module.exports.printErr = (err) => {
1212
console.log('Please check your uri / network connection')
1313
}
1414

15-
console.dir(err.message)
15+
process.exit(1)
1616
}

img2ascii.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = (config) => {
77
const gm = require('gm')
88
const pictureTube = require('picture-tube')
99

10-
const isUrl = (str) => str.match(/^http|0\.0|1..\.|localhost/)
10+
const isUrl = (str) => str.match(/^(http|0\.0|1..\.|localhost)/)
1111

1212
const pipeIn = (isUrl(argv._[0]) ?
1313
require('request-promise')(argv._[0]) :

0 commit comments

Comments
 (0)