Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在将Elmah用于 MVC 应用程序,我的问题是
使用 Elmah 时不写 try catch 语句是不好的做法吗?
ELMAH 用于记录未处理的异常。如果您可以处理异常,我强烈建议您这样做。
如果您仍想将异常记录到 ELMAH,您可以这样做:
try { ... } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e) }