Skip to content

Callback now made when error occurs during request execution. #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/apicontrollersbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class APIOperationBase {
if(this._response){
message = this._response.message;
}

return message;
}

Expand All @@ -58,7 +58,7 @@ class APIOperationBase {

setClientId() {
for(var obj in this._request){
this._request[obj]['clientId'] = config.clientId;
this._request[obj]['clientId'] = config.clientId;
break;
}
}
Expand Down Expand Up @@ -99,7 +99,8 @@ class APIOperationBase {
request(reqOpts, function(error, response, body){
if(error) {
logger.error(error);
} else
callback(error, null);
} else
{
//TODO: slice added due to BOM character. remove once BOM character is removed.
var responseObj = JSON.parse(body.slice(1));
Expand All @@ -112,7 +113,7 @@ class APIOperationBase {
logger.debug("Response: " + JSON.stringify(body, 2, null));
obj._response = body;
*/
callback();
callback(null, responseObj);
}
});

Expand Down