• 2023-12-05std::io::Error, thiserror和anyhow
    std::io::Error,thiserror和anyhow读到一篇非常好的文章baoyachi大佬的<细说Rust错误处理>从Rust中怎么处理错误,讲到怎么定义自己的错误类型,再到如何简化错误处理流程,再到如何统一错误处理的形式.但是这些都是基于标准库提供功能实现的,需要手动写一些模板代码来完成这
  • 2022-10-29golang中的nil接收器
    我们先看一个简单的例子,我们自定义一个错误,用来把多个错误放在一起输出:typeCustomErrorstruct{errors[]string}func(c*CustomError)Add(errstring){c.errors=
  • 2022-10-28asp.net mvc 3 配置全局异常处理 Web.config中设置CustomError
    Web.config中设置CustomErrorCustomError定义自动处理异常的行为,如下所示:<system.web><!--<customErrorsmode="RemoteOnly"defaultRedirect="~/error.html"/>--><cust
  • 2022-10-23golang中的nil接收器
    索引:https://waterflow.link/articles/1666534616841我们先看一个简单的例子,我们自定义一个错误,用来把多个错误放在一起输出:typeCustomErrorstruct{ errors[]string