Fixes error codes against Insight
This commit is contained in:
parent
9788235003
commit
5f035a9680
4 changed files with 9 additions and 3 deletions
|
|
@ -37,6 +37,9 @@ InsightStorage.prototype.getItem = function(name, callback) {
|
|||
if (err) {
|
||||
return callback('Connection error');
|
||||
}
|
||||
if (response.statusCode === 403) {
|
||||
return callback('PNOTFOUND: Profile not found');
|
||||
}
|
||||
if (response.statusCode !== 200) {
|
||||
return callback('Connection error');
|
||||
}
|
||||
|
|
@ -61,6 +64,9 @@ InsightStorage.prototype.setItem = function(name, value, callback) {
|
|||
if (err) {
|
||||
return callback('Connection error');
|
||||
}
|
||||
if (response.statusCode === 409) {
|
||||
return callback('Invalid username or password');
|
||||
}
|
||||
if (response.statusCode !== 200) {
|
||||
return callback('Unable to store data on insight');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue