Frustration of purpose

Frustration of purpose, in law, is a defense to enforcement of a contract. Frustration of purpose occurs when an unforeseen event undermines a party's principal purpose for entering into a contract such that the performance of the contract is radically different from performance of the contract that was originally contemplated by both parties, and both parties knew of the principal purpose at the time the contract was made. Despite frequently arising as a result of government action, any third party or even nature can frustrate a contracting party's primary purpose for entering into the contract. The concept is also called commercial frustration.
For example, if Joe gets a mortgage for a new home, suppose after three years, the home is destroyed, through no fault of Joe's. Without a hell or high water clause, Joe might be exempt from the remainder of the mortgage, as the principal purpose of the contract, to have a home to live in, has been compromised. However, he might still have a foreclosure on his credit rating.
Frustration of purpose is often confused with the closely related doctrine of impossibility. The distinction is that impossibility concerns the duties specified in the contract, but frustration of purpose concerns the reason a party entered into the contract. An example is if entrepreneur Emily leases space from landlord Larry so that she can open a restaurant that serves only Tibetan Speckled Lizard meat. If the city rezones the property to forbid commercial uses or if the property is destroyed by a tornado, both Larry and Emily are excused from performing the contract by impossibility.
However, if the Tibetan Speckled Lizard suddenly goes extinct, Emily may be excused from performing the contract because Larry knew her primary purpose for entering into the lease was to serve Tibetan Speckled Lizard, and the purpose has been frustrated. In the second scenario, the parties could still carry out their obligations under the lease, but one of them no longer has a reason to.
The "Restatement (Second) of Contracts", Section 265, defines frustration of purpose:
A circumstance is not deemed to be a "basic assumption on which the contract is made" unless the change in circumstances could not have been reasonably foreseen at the time the contract was made. As a result, it is rarely invoked successfully. Successful invocations usually come in waves during times of substantial tumult, such as after the passage of Prohibition, when bars and taverns no longer had a reason for their leases, or during major wars, when demand for many consumer goods and services drops far below what is normal.
If the defense is successfully invoked, the contract is terminated, and the parties are left as they are at the time of the litigation.
In English law.
The English case of "Taylor v Caldwell" established the doctrine of frustration, alleviating the potential harshness of "sanctity of contract". Here, two parties contracted on the hire of a music hall, for the performance of concerts. Subsequent to contract, but prior to the dates of hire, the music hall burned down. Since the contract was impossible to perform, Judge Blackburn held that the absolute liability set forth in "Paradine v Jane" would not apply here, as there was an implied term that the music hall would be in existence at the date of the planned concerts. 
The requirement of "impossibility" in "Taylor v Caldwell" was modified in the 1903 case of "Krell v Henry", which concerned a party who had rented a room for the purpose of watching the coronation procession of Edward VII. The king fell ill and the coronation was indefinitely postponed. The hirer refused to pay for the room, so the owner sued for breach of contract; and the hirer then countersued for the return of his £25 deposit. The court determined that the cancellation of the coronation was unforeseeable by the parties, and discharged the contract, leaving the parties as they were: the hirer lost his one-third deposit, and the owner lost the rest of the rent. The court reasoned that the doctrine of "impossibility" could not be applied in this case because it was technically possible for the hirer to take possession of the flat and sit on the balcony. However, the owner knew the only reason the hirer would want to rent the flat was to watch the procession; had the hirer actually gone to the flat and sat on the balcony, he would have seen nothing of interest. Thus the purpose of the contract had been frustrated by an outside event (the King's illness and consequent cancellation of the parade), justifying termination (but not rescission) of the contract.
In Australian law.
The Australian case of Codelfa Construction Pty Ltd v State Rail Authority of NSW, The case of Codelfa is a pre-eminent case in Australian law of frustration of a contract, applying a tripartite test, namely, an obligation under the contract is incapable of being performed, without fault of either of the parties (eg, the parties didn't cause the frustrating event to occur), because the circumstances have rendered performance to be radically different.
Frustration will not be recognised if: