Add error codes to api responses

This commit is contained in:
Nick O'Leary
2015-03-31 22:29:15 +01:00
parent 31b018c80e
commit fbfc5c8a2d
5 changed files with 19 additions and 19 deletions

View File

@@ -74,7 +74,9 @@ function checkTypeInUse(id) {
});
if (nodesInUse.length > 0) {
var msg = nodesInUse.join(", ");
throw new Error("Type in use: "+msg);
var err = new Error("Type in use: "+msg);
err.code = "type_in_use";
throw err;
}
}
}