Patent ID: 8782607

Claim:
A computer-implemented method for allowing a software application to respond to a failed contract condition specified by an author of the application, the method comprising: determining whether a contract condition failed, wherein the contract condition is included in a stream of instructions that execute along with software code that comprises functional elements of the software application, and wherein in response to encountering a contract condition, the processor executes the condition alongside other software instructions; if the contract condition failed, determining whether an event handling routine is registered for handling the failed contract condition; in response to determining that an event handling routine is registered, invoking the event handling routine, wherein an error handling system provides an event that a hosting application that hosts hosted software code can register to handle and that the system invokes upon detecting a contract failure within the hosted software code in a manner that the hosting application's response to the event determines how the system further handles the failure; receiving a response from the event handling routine that indicates whether the event handling routine handled the failed contract condition and invoking the escalation policy in response to determining that the event handling routine did not handle the failed contract condition; and based on a returned result from the registered event handling routine, invoking an execution policy that specifies a configured action for handling contract condition failures, wherein the preceding steps are performed by at least one processor.