summaryrefslogtreecommitdiff
path: root/node/db/PadManager.js
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-12-10 16:46:47 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-12-10 16:46:47 +0100
commit6684d6ed5241b4ededc5cc0ae5a2eaae0ba84d09 (patch)
tree02db4fb0602ca0a3d99d66ea177b8606fd6aea93 /node/db/PadManager.js
parent22fd5ae33dc6a8f410a630f33bfb6261051656e8 (diff)
downloadetherpad-lite-6684d6ed5241b4ededc5cc0ae5a2eaae0ba84d09.zip
replaced all stop callbacks with customError callbacks. Fixes #270
Diffstat (limited to 'node/db/PadManager.js')
-rw-r--r--node/db/PadManager.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/node/db/PadManager.js b/node/db/PadManager.js
index 7471a0f2..36c27263 100644
--- a/node/db/PadManager.js
+++ b/node/db/PadManager.js
@@ -19,6 +19,7 @@
*/
var ERR = require("async-stacktrace");
+var customError = require("../utils/customError");
require("../db/Pad");
var db = require("./DB").db;
@@ -47,7 +48,7 @@ exports.getPad = function(id, text, callback)
//check if this is a valid padId
if(!exports.isValidPadId(id))
{
- callback({stop: id + " is not a valid padId"});
+ callback(new customError(id + " is not a valid padId","apierror"));
return;
}
@@ -64,14 +65,14 @@ exports.getPad = function(id, text, callback)
//check if text is a string
if(typeof text != "string")
{
- callback({stop: "text is not a string"});
+ callback(new customError("text is not a string","apierror"));
return;
}
//check if text is less than 100k chars
if(text.length > 100000)
{
- callback({stop: "text must be less than 100k chars"});
+ callback(new customError("text must be less than 100k chars","apierror"));
return;
}
}