Skip to content

Instantly share code, notes, and snippets.

@DanielVF
Created January 29, 2009 17:58
Show Gist options
  • Save DanielVF/54651 to your computer and use it in GitHub Desktop.
Save DanielVF/54651 to your computer and use it in GitHub Desktop.
//in public void Update()
//change
if (updateResult.Errors) { throw new CouldNotUploadBudget(); }
//to
if (updateResult.Errors) { throw new CouldNotUploadBudget( this, updateResult); }
//change
public class CouldNotUploadBudget : System.Exception { }
//to
public class CouldNotUploadBudget : System.Exception {
public BudgetUpdate budgetUpdate;
public BudgetUpdateResult updateResult;
public CouldNotUploadBudget(BudgetUpdate budgetUpdate, BudgetUpdateResult updateResult){
this.budgetUpdate=budgetUpdate;
this.updateResult=updateResult;
}
public string errors(){
string errors = "";
foreach (WS.UpdateElementResult detail in this.updateResult.Details){
errors = errors + detail.Message +". ";
}
return errors;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment