Avoid BaseException.message deprecation warnings.