Skip to content
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

Fix unhandled Type Error #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions lib/js/ZCRMRestClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ var default_user_identifier = "zcrm_default_user";
);
}
else{

console.log("Problem occured while generating access token from refresh token. Response : "+JSON.stringify(response))
reject(resultObj)
throw new Error("Problem occured while generating access token and refresh token from grant token.Response : "+JSON.stringify(response));
}
})
Expand Down Expand Up @@ -335,4 +336,4 @@ ZCRMRestClient.parseAndConstructObject = function(response){

ZCRMRestClient.API = require('./crmapi');

module.exports = ZCRMRestClient;
module.exports = ZCRMRestClient;
9 changes: 8 additions & 1 deletion lib/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ function makeapicall(request){
if(error){
resolve(error);
}
else if(!response){
var respObj = {
"message" : "failed response", //No I18N
"status_code" : "204" //No I18N
}
resolve(JSON.stringify(respObj));
}
else if(response.statusCode == 204){

var respObj = {
Expand Down Expand Up @@ -239,4 +246,4 @@ module.exports = {
constructRequestDetails : constructRequestDetails,
promiseResponse : promiseResponse,

}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zcrmsdk",
"version": "0.0.20",
"version": "0.0.22",
"description": "Node SDK for Zoho CRM",
"main": "lib/js/ZCRMRestClient",
"dependencies": {
Expand Down