Most contemporary software applications presuppose an error-free system environment. While this assumption is often correct, the system can break down under exceptional situations, such as resource exhaustion or network failures. Unfortunately, too few developers deal with these issues, since they rarely arise in normal testing scenarios and are usually treated as ”exceptional” cases to be handled outside the course of regular programming. We attempt to ameliorate this situation by producing a library (libfig) that induces errors at the application/operating system boundary in a controlled manner. Our intent is that this library be used as a tool for software development and verification, as well as for on-site testing of production systems. We use a working version of this tool to test the behavior of several common UNIX applications under simulated failures, and offer suggestions on how to develop software that is more resilient to failures in the system environment.