diff --git a/src/storage/filesystem.js b/src/storage/filesystem.js index 4b2d4a820..a96a1b7d9 100644 --- a/src/storage/filesystem.js +++ b/src/storage/filesystem.js @@ -115,7 +115,7 @@ function restore(apiConfig, backupId, destination, callback) { if (!fs.existsSync(sourceFilePath)) return callback(new BackupsError(BackupsError.NOT_FOUND, 'backup file does not exist')); mkdirp(destination, function (error) { - if (error) return callback(error); + if (error) return callback(new BackupsError(BackupsError.INTERNAL_ERROR, error)); var fileStream = fs.createReadStream(sourceFilePath); var decipher = crypto.createDecipher('aes-256-cbc', apiConfig.key || '');