3.x compatible exception handling