handle exceptions gracefully in web module