zoukankan      html  css  js  c++  java
  • 异常处理方式

    C# 异常

    异常情景

     错误提示

    2020-02-26 14:43:55,528 线程ID: [47] 耗时:[611] ERROR>> [出错类:PassTrain.BLL.Train_BLL;出错消息:Aitest_Review_PushMarkResultByReviewClouds]
    System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
       at PassTrain.Exercise.ReviewSocket_Basic.SendReviewData(String JsonData, String UserId)
       at PassTrain.BLL.Train_BLL.Aitest_Review_PushMarkResultByReviewClouds(Object info)

    出现错误情况

    字典一旦赋了键值便不能够在循环里面进行修改/删除等操作,只能获取

    解决方法

    可以将foreach循环修改改为for循环

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    异常情景:

    错误提示:

    2020-02-26 18:44:54,993 线程ID: [8] 耗时:[70] ERROR>> 开启日志文件的配置时异常==>
    System.NullReferenceException: Object reference not set to an instance of an object.
       at PassTrain.Helper.LogHelper.setlogEnable()

    出现错误情况:

    未做空处理

    解决方法:

    如上图

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    IIS异常

    AddBy 2020-12-23

     无法读取json文件(web.config配置文件异常),解决案例:https://blog.csdn.net/yinsefeixingchuan/article/details/107444511

    Web.config文件进行相关配置

     <system.webServer>
        <staticContent>
          <remove fileExtension=".json" />
          <mimeMap fileExtension=".json" mimeType="application/json" />
          <mimeMap fileExtension=".mrt" mimeType="application/json" />
        </staticContent>
    
      </system.webServer>

    EndBy 2020-12-23

    异常情景:

    错误提示:

    出现错误情况:

    解决方法:

  • 相关阅读:
    完爆!用边缘容器,竟能秒级实现团队七八人一周的工作量
    手把手教你使用 cert-manager 签发免费证书
    手把手教你使用 Nginx Ingress 实现金丝雀发布
    Codeforces 534B Covered Path 贪心
    Codeforces 534A Exam 水
    Topcoder open 2015 Round 1A 250 Similars 枚举 + 状压
    Topcoder SRM 654 DIV1 500 FoldingPaper2 递归 + 枚举
    Topcoder SRM655 DIV2 250 BichromeBoard 水
    2015 Google code jam Qualification Round B 枚举 + 贪心
    2015 Google code jam Qualification Round A 水
  • 原文地址:https://www.cnblogs.com/namejr/p/12367237.html
Copyright © 2011-2022 走看看