相关疑难解决方法(0)

我应该抓住并包装一般的例外吗?

以下代码可以被视为一种良好做法吗?如果没有,为什么?

try
{
    // code that can cause various exceptions...
}
catch (Exception e)
{
    throw new MyCustomException("Custom error message", e);
}
Run Code Online (Sandbox Code Playgroud)

.net c# exception-handling exception

13
推荐指数
4
解决办法
4232
查看次数

标签 统计

.net ×1

c# ×1

exception ×1

exception-handling ×1