这篇文章发布于 219 天前,部分信息可能已经发生变化。
The trick is to recognize the type of exception being thrown and cast the General Exception to the correct Type where you will then have access to extended properties for that Exception type.
大致意思:诀窍在于识别被抛出的异常的类型,并将一般异常转换为正确的类型,这样你就可以访问该异常类型的扩展属性了。
Demo:
catch (UFSoft.UBF.Business.BusinessException e)
{
throw new Exception("RCV:" + entity.DocNo + "审核失败:" + e.InnerException.Message);
}