Hi,
Apex Rest request 3 out of 5 requests go through fine and don't fail, but occasionally I receive an "Invalid URI" Error. Why does this error only occur some of the time and not every time? The URI is correct, I've tested it in many other instances, but it continues to occasionally fail with jforce.
var sfUrl = process.env.SF_URL,
sfUsername = process.env.SF_USERNAME,
sfPassword = process.env.SF_PASSWORD,
sfSecurityToken = process.env.SF_TOKEN;
this.sfConn = new jsforce.Connection({
loginUrl: sfUrl
});
this.sfConn.login(sfUsername, sfPassword + sfSecurityToken, function(err, res) {
if (err) {
console.log(new Date() + ': [ERROR] SF LOGIN (' + err + ')');
if (retryNum > 0) {
console.log('Retrying...');
setTimeout(function(){ sfLogin(retryNum - 1, callback); }, 2000);
} else if (callback) {
callback(err);
}
} else if (callback) {
callback(err);
}
});
this.sfConn.apex.get('/' + name, function(err, res) {
if (err) {
console.log(new Date() + ': [ERROR] SF CPT GET API: ' + name + ' (' + err + ')');
console.log(res);
if (retryNum > 0) {
console.log('Retrying...');
setTimeout(function(){ cptGetAPI(name, retryNum - 1, callback); }, 2000);
} else if (callback) {
callback(err);
}
} else if (callback) {
callback(err, res);
}
});
Thanks,
Tom
I have a related issue and have also posted this question on stackexchange.
Not sure if its related to jsforce or the API endpoint itself.
The error I get is also erratic and doesn't happen all the times.
The error I get back is:
[Error: Invalid URI "/services/data/v37.0/sobjects/Account"]
Most helpful comment
I have a related issue and have also posted this question on stackexchange.
Not sure if its related to jsforce or the API endpoint itself.
The error I get is also erratic and doesn't happen all the times.
The error I get back is:
[Error: Invalid URI "/services/data/v37.0/sobjects/Account"]