storage: fix file not found message

This commit is contained in:
Girish Ramakrishnan
2018-07-30 07:39:34 -07:00
parent 3067d87ca9
commit a1070b7da3
3 changed files with 10 additions and 6 deletions

View File

@@ -68,9 +68,9 @@ function download(apiConfig, sourceFilePath, callback) {
assert.strictEqual(typeof sourceFilePath, 'string');
assert.strictEqual(typeof callback, 'function');
debug('download: %s', sourceFilePath);
debug(`download: ${sourceFilePath}`);
if (!safe.fs.existsSync(sourceFilePath)) return callback(new BackupsError(BackupsError.NOT_FOUND, 'File not found'));
if (!safe.fs.existsSync(sourceFilePath)) return callback(new BackupsError(BackupsError.NOT_FOUND, `File not found: ${sourceFilePath}`));
var fileStream = fs.createReadStream(sourceFilePath);
callback(null, fileStream);