Fixes BaseException.message deprecation for catching errors