<small id='Rg7H1'></small><noframes id='Rg7H1'>

      • <bdo id='Rg7H1'></bdo><ul id='Rg7H1'></ul>

      <tfoot id='Rg7H1'></tfoot>

        <legend id='Rg7H1'><style id='Rg7H1'><dir id='Rg7H1'><q id='Rg7H1'></q></dir></style></legend>

        <i id='Rg7H1'><tr id='Rg7H1'><dt id='Rg7H1'><q id='Rg7H1'><span id='Rg7H1'><b id='Rg7H1'><form id='Rg7H1'><ins id='Rg7H1'></ins><ul id='Rg7H1'></ul><sub id='Rg7H1'></sub></form><legend id='Rg7H1'></legend><bdo id='Rg7H1'><pre id='Rg7H1'><center id='Rg7H1'></center></pre></bdo></b><th id='Rg7H1'></th></span></q></dt></tr></i><div id='Rg7H1'><tfoot id='Rg7H1'></tfoot><dl id='Rg7H1'><fieldset id='Rg7H1'></fieldset></dl></div>

        是“死是真棒"?首选?

        时间:2023-05-21
        <tfoot id='vlbUo'></tfoot>
        <i id='vlbUo'><tr id='vlbUo'><dt id='vlbUo'><q id='vlbUo'><span id='vlbUo'><b id='vlbUo'><form id='vlbUo'><ins id='vlbUo'></ins><ul id='vlbUo'></ul><sub id='vlbUo'></sub></form><legend id='vlbUo'></legend><bdo id='vlbUo'><pre id='vlbUo'><center id='vlbUo'></center></pre></bdo></b><th id='vlbUo'></th></span></q></dt></tr></i><div id='vlbUo'><tfoot id='vlbUo'></tfoot><dl id='vlbUo'><fieldset id='vlbUo'></fieldset></dl></div>
          <tbody id='vlbUo'></tbody>
          • <small id='vlbUo'></small><noframes id='vlbUo'>

              <bdo id='vlbUo'></bdo><ul id='vlbUo'></ul>

              <legend id='vlbUo'><style id='vlbUo'><dir id='vlbUo'><q id='vlbUo'></q></dir></style></legend>

                1. 本文介绍了是“死是真棒"?首选?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  最近我参加了 Jeffrey Richter 的 .NET 培训课程.他提到了一种编码策略死是真棒".也就是说,即使在程序或事件循环的根部也不要写catch (Exception ex)".如果抛出了一些未处理的异常,就让进程死掉.

                  Recently I attended Jeffrey Richter's training courses about .NET. He mentions one strategy of coding "Dying is awesome". That is, don't write "catch (Exception ex)" even at the root of program or event loop. If some exception thrown that is not handled, just let the process die.

                  我不确定这是否正确.就个人而言,我更喜欢在执行的顶层使用try {...} catch(Exception ex) {log and try to recover}"来包装.实际上,如果从 asXx 抛出任何异常,ASP.NET 不会死.如果它确实因异常而死,那么一个灵丹妙药的请求可以使整个服务保持沉默.

                  I'm not sure this is right. Personally, I prefer to have a "try {...} catch(Exception ex) {log and try to recover}" to wrap at the top level of execution. Actually, ASP.NET doesn't die if any exception is throw from asXx. If it does die for exception, then one silver-bullet request can silence the whole service.

                  你怎么看?

                  推荐答案

                  我认为这取决于您正在运行什么样的应用程序以及死亡"的后果是什么.对于许多客户端应用程序来说,死亡真是太棒了.对于服务器,通常不是那么多(吞下日志是合适的).没有万能的解决方案.

                  I think it depends on what kind of app you are running and what the consequences of 'dying' are. For many client apps, dying is awesome. For servers, often not so much (and swallow-and-log is appropriate). There's no one-size-fits-all solution.

                  这篇关于是“死是真棒"?首选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:C#:“'System.InvalidOperationException' 类型的第一次机会异常&qu 下一篇:保护 Windows 服务免受不受信任的用户的侵害

                  相关文章

                    <small id='3Hw3r'></small><noframes id='3Hw3r'>

                    <i id='3Hw3r'><tr id='3Hw3r'><dt id='3Hw3r'><q id='3Hw3r'><span id='3Hw3r'><b id='3Hw3r'><form id='3Hw3r'><ins id='3Hw3r'></ins><ul id='3Hw3r'></ul><sub id='3Hw3r'></sub></form><legend id='3Hw3r'></legend><bdo id='3Hw3r'><pre id='3Hw3r'><center id='3Hw3r'></center></pre></bdo></b><th id='3Hw3r'></th></span></q></dt></tr></i><div id='3Hw3r'><tfoot id='3Hw3r'></tfoot><dl id='3Hw3r'><fieldset id='3Hw3r'></fieldset></dl></div>
                  1. <tfoot id='3Hw3r'></tfoot>

                      • <bdo id='3Hw3r'></bdo><ul id='3Hw3r'></ul>
                      <legend id='3Hw3r'><style id='3Hw3r'><dir id='3Hw3r'><q id='3Hw3r'></q></dir></style></legend>