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

Need Better Error Handling #55

Open
OscarGodson opened this issue Jul 15, 2011 · 0 comments
Open

Need Better Error Handling #55

OscarGodson opened this issue Jul 15, 2011 · 0 comments
Labels

Comments

@OscarGodson
Copy link
Contributor

I started to do it, but then I got lazy. Everything that gets a return should be wrapped in an error like this:

app().api({
  "action":"create",
  "emergency":emergencyItem,
  "type":type,
  "heading":modal.find('[name=heading]').val(),
  "topic":modal.find('[name=topic]').val(),
  "id":$('.session:first').attr('id').split('-')[1]
},
function(json){
  if(!json.error){
    addRemoveBureausOwners('owner',json.item_id);
    addRemoveBureausOwners('bureau',json.item_id);
    displayAgenda(dataStore('active-agenda'));
    app().modal('close')
  }
  else{
    alert('Error: '+json.error);
  }
});

Marked as a feature because it'll help for debugging purposes for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant