-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patherror.js
105 lines (95 loc) · 1.7 KB
/
error.js
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
Used to have à la restify errors when using the http module from node
for freebox calls
Maybe using restify everywhere is a better solution ?
*/
exports.enabledMissing = {
header: {
httpCode: 400
},
body: {
code:'BadRequest',
message: 'enabled=true/false is mandatory'
}
};
exports.enabledWrongValue = {
header: {
httpCode: 400
},
body: {
code:'BadRequest',
message: 'enabled can only take true or false as value'
}
};
exports.ddnsServiceMising = {
header: {
httpCode: 400
},
body: {
code:'BadRequest',
message: 'You must specify the service you want to configure (dyndns or noip)'
}
};
exports.httpPortMissing = {
header: {
httpCode: 400
},
body: {
code: 'BadRequest',
message: 'http_port must be specified'
}
};
exports.wrongAuth = {
header: {
httpCode: 401
},
body: {
code: 'Unauthorized',
message: 'Incorrect login/password'
}
};
exports.emptyAuth = {
header: {
httpCode: 401
},
body: {
code: 'Unauthorized',
message: 'You must specify a login and password'
}
};
exports.invalidToken = {
header: {
httpCode: 401
},
body: {
code: 'Unauthorized',
message: 'Token is either invalid or has expired'
}
};
exports.invalidCookie = {
header: {
httpCode: 401
},
body: {
code: 'Unauthoried',
message: 'Cookie seems to have expired, reconnect.'
}
};
exports.missingToken = {
header: {
httpCode: 401
},
body: {
code: 'Unauthorized',
message: 'You must specify a token.'
}
};
exports.internalServerError = {
header: {
httpCode: 500
},
body: {
code: 'InternalServerError',
message: 'Unknown Server Error.'
}
};