Use specific error if app backup for restore can't be found

This commit is contained in:
Johannes Zellner
2016-10-10 13:21:45 +02:00
parent d53657fa61
commit 629e061743
3 changed files with 5 additions and 1 deletions

View File

@@ -749,6 +749,7 @@ function restore(appId, data, auditSource, callback) {
var func = data.backupId ? backups.getRestoreConfig.bind(null, data.backupId) : function (next) { return next(null, { manifest: app.manifest }); };
func(function (error, restoreConfig) {
if (error && error.reason === BackupsError.NOT_FOUND) return callback(new AppsError(AppsError.EXTERNAL_ERROR, error.message));
if (error && error.reason === BackupsError.EXTERNAL_ERROR) return callback(new AppsError(AppsError.EXTERNAL_ERROR, error.message));
if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error));