noeticpenguin / ngForce

Force.com && Angular.js integration framework.
noeticpenguin.github.io/ngForce
MIT License
142 stars 61 forks source link

Error Handling #26

Closed patrickjamesbarry closed 9 years ago

patrickjamesbarry commented 9 years ago

Do you have any documentation on how to perform error handling using this library? Example: What happens when the Salesforce session times-out?

noeticpenguin commented 9 years ago

@patrickjamesbarry

Since the library is promises based, and uses the standard Angular $q library for promises you can always append an error function to your promise chain. ie:

var contactQueryPromise = vfr.query("select id, name from contact where state = 'tx' ");
contactQueryPromise.then(function(x){
  // do something with x
},
function(err) {
  //handle error
});