In some cases it is convenient to interrupt the flow of execution with
a failure instead of a value: this is where the predefined function
failwith comes in.
The failwith function raises an error that cannot be caught and terminates the execution of the contract.
The call to
failwith sometimes needs to be annotated with a type
when the type-checker cannot infer the correct type, e.g.
"message" : type_of_result).