-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.js
More file actions
72 lines (70 loc) · 1.64 KB
/
errors.js
File metadata and controls
72 lines (70 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// TODO: Consolidate not found errors into one error. Maybe even include
// doesnotexist in that bunch too.
module.exports = {
notFound: function(message){
return {
error: 'not_found',
message: message
}
},
emailInUse: function(email){
return {
error: 'email_in_use',
message: "Email '"+ email +"' is already being used by another member."
}
},
operationDidNotReturnDoc: function(){
return {
error: 'operation_did_not_return_doc',
message: "The atomic operation did not return a document."
}
},
designNotFound: function(design_name){
return {
error: 'design_not_found',
message: "The design '"+ design_name +"' could not be found."
}
},
emailNotFound: function(email){
return {
error: 'email_not_found',
message: "Could not find a user with email '"+ email +"'."
}
},
incorrectPassword: function(){
return {
error: 'incorrect_password',
message: 'Incorrect password.'
}
},
doesNotExist: function(id){
return {
error: 'does_not_exist',
message: "'"+ id +"' does not exist."
}
},
argumentError: function(message){
return {
error: 'argument_error',
message: message
}
},
configError: function(message){
return {
error: 'config_error',
message: message
}
},
alreadyMarked: function(mark_name){
return {
error: 'already_marked',
message: 'This document is already marked "'+ mark_name +'".'
}
},
notMarked: function(mark_name){
return {
error: 'not_marked',
message: 'This document is not marked "'+ mark_name +'".'
}
}
}