Split file-based input errors into missing vs invalid #1542

This commit is contained in:
Lovell Fuller
2019-01-19 11:59:36 +00:00
parent fa69ff773a
commit d5e98bc8ad
5 changed files with 36 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ const sharp = require('../build/Release/sharp.node');
*/
function toFile (fileOut, callback) {
if (!fileOut || fileOut.length === 0) {
const errOutputInvalid = new Error('Invalid output');
const errOutputInvalid = new Error('Missing output file path');
if (is.fn(callback)) {
callback(errOutputInvalid);
} else {