Caching and ruby exceptions

How do I prevent an action from being cached when a ruby exception occurs in that action? Right now it seems to cache an empty file.

Thanks, B