Added ability for modules writers to provide their own exceptions.