1. A non-transitory computer-readable storage medium storing program instructions executable by a computer to implement a compiler, wherein the compiler is configured to: receive source code that includes a first user source code block capable of throwing a first exception and a second user source code block capable of throwing a second exception, wherein the source code is associated with a policy that discards a pending exception when a subsequent exception occurs; and transform the source code, wherein the transformed source code, when executed, allows the first exception as the pending exception to be propagated and the second exception as the subsequent exception to be stored for later retrieval or handling.