From 72b0a484839f254654cd3241fc5f128f4ea24e9c Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Sat, 27 Sep 2014 19:05:35 +0000 Subject: [PATCH] Fix DB API no ref - Use correct error type --- core/server/api/db.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/server/api/db.js b/core/server/api/db.js index ad0966273c..a63309c53b 100644 --- a/core/server/api/db.js +++ b/core/server/api/db.js @@ -45,7 +45,7 @@ db = { return Promise.reject(new errors.InternalServerError(error.message || error)); }); }, function () { - return Promise.reject(new errors.NoPermissionError('You do not have permission to export data. (no rights)')); + return Promise.reject(new errors.NoPermissionError('You do not have permission to export data (no rights).')); }); }, /** @@ -101,7 +101,7 @@ db = { } } catch (e) { errors.logError(e, 'API DB import content', 'check that the import file is valid JSON.'); - return Promise.reject(new errors.BadRequest('Failed to parse the import JSON file')); + return Promise.reject(new errors.BadRequestError('Failed to parse the import JSON file.')); } if (!importData.meta || !importData.meta.version) { @@ -119,7 +119,7 @@ db = { return Promise.promisify(fs.unlink)(filepath); }); }, function () { - return Promise.reject(new errors.NoPermissionError('You do not have permission to import data. (no rights)')); + return Promise.reject(new errors.NoPermissionError('You do not have permission to import data (no rights).')); }); }, /** @@ -140,7 +140,7 @@ db = { return Promise.reject(new errors.InternalServerError(error.message || error)); }); }, function () { - return Promise.reject(new errors.NoPermissionError('You do not have permission to export data. (no rights)')); + return Promise.reject(new errors.NoPermissionError('You do not have permission to export data (no rights).')); }); } };