首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏一行舟

    Go errors

    Hi,我是行舟,今天和大家一起学习 Go 语言错误处理包:errors。 Go 语言自身的 errors:https://golang.google.cn/pkg/errors/ 包实现非常简单,使用起来非常灵活,但是又有很多不足。 我们在分析 Go 语言 errors 包的同时,也介绍下一个开源的 errors 包:https://pkg.go.dev/github.com/pkg/errors。 开源 errors 仓库地址:https://pkg.go.dev/github.com/pkg/errors 它实现了更加丰富的 error 方法。 为什么需要 Wrap errors

    71520编辑于 2022-08-25
  • 来自专栏全栈程序员必看

    Python Errors and Exceptions

    python中的异常处理的keyword和c#中的是不同样的,python中使用try,except关键在来处理异常,例如以下:

    31530编辑于 2022-07-13
  • 来自专栏szhshp 的第四边境中转站

    ColdFusion - Errors & Troubleshooting

    的 index 应该是数字而不是字符串# The request has exceeded the allowable time limit Tag: CFQUERY

    64750编辑于 2022-09-21
  • Go 代码的进化美学:errors.Is 和 errors.As

    如今,Go 1.13 带来的 errors.Is 和 errors.As,就像一道曙光,照亮了错误处理的黑夜。结合我的经验,这篇文章就来一起探索这对"兄弟"背后的设计美学。 errors.Is:火眼金睛的错误值匹配 errors.Is 的作用是在错误链中查找与目标错误"相等"的错误。 errors.As:抽丝剥茧的错误类型提取 如果说 errors.Is 是"火眼金睛",那么 errors.As 就是"火眼金睛加神兵利器"。 类似,errors.As 也支持自定义行为。 写在最后 从 errors.New 到 fmt.Errorf,从字符串匹配到 errors.Is 和 errors.As,Go 的错误处理经历了优雅的进化。

    12410编辑于 2026-03-27
  • 来自专栏Go与云原生开发

    Go 源码解读|如何用好 errors 库的 errors.Is() 与 errors.As() 方法

    扯远了,写作这篇文章的原因是我在写单元测试的时候,有时会涉及 errors.Is 和 errors.As 方法的调用,借此做一个总结。 var BaseErr = errors.New("the underlying base error") func main() { err1 := fmt.Errorf("wrap base: errors.Is 判断被包装的error是否包含指定错误。 var BaseErr = errors.New("the underlying base error") func main() { err1 := fmt.Errorf("wrap base errors.As 提取指定类型的错误,判断包装的 error 链中,某一个 error 的类型是否与 target 相同,并提取第一个符合目标类型的错误的值,将其赋值给 target。

    1.3K50编辑于 2022-12-20
  • 来自专栏前端达人

    JavaScript Errors 指南

    at throwError (http://mknichel.github.io/javascript-errors/javascript-errors.js:27:9) at fnVariableName /javascript-errors/javascript-errors.js:137:3) 在IE11,中会是这样的。 code] evalError@http://mknichel.github.io/javascript-errors/javascript-errors.js:137:7 在Firefox 中: Error from eval evaledFunction@http://mknichel.github.io/javascript-errors/javascript-errors.js line 137 > eval:1:36 @http://mknichel.github.io/javascript-errors/javascript-errors.js line 137

    2.5K20发布于 2020-11-30
  • 来自专栏全栈程序员必看

    Errors reported by CheckUpDown

    Errors reported by CheckUpDown Introduction to errors Any client (e.g. your Web browser or our CheckUpDown errors Errors with a code in the range 001-099 indicate a fundamental failure to communicate, typically errors Errors with a code in the range 300-399 indicate a redirection of the Web site URL. errors Errors with a code in the range 500-599 occur where the Web server reports an internal error in errors Errors with a code in the range 300-399 indicate a redirection of the Web site URL.

    89230发布于 2021-05-19
  • 来自专栏计算机视觉理论及其实现

    tf.errors

    MembersABORTEDALREADY_EXISTSCANCELLEDDATA_LOSSDEADLINE_EXCEEDEDFAILED_PRECONDITIONINTERNALINVALID_ARGUMENTNOT_FOUNDOKOUT_OF_RANGEPERMISSION_DENIEDRESOURCE_EXHAUSTEDUNAUTHENTICATEDUNAVAILABLEUNIMPLEMENTEDUNKNOWN二、重要的类1、类OutOfRangeErrorInherits From: OpErrorDefined in tensorflow/python/framework/errors_impl.py.See

    94730编辑于 2022-09-03
  • 来自专栏陌无崖知识分享

    Working with Errors in Go 1.13

    尽管标准库对错误的支持很简单(仅是errors.New和fmt.Errorf函数,它们产生的错误仅包含一条消息),但是内置的错误接口使Go程序员可以添加所需的任何信息。 errors.is函数将错误与值进行比较。 is set to the error's value } 在最简单的情况下,errors.Is函数的行为类似于对哨兵错误的比较,而errors.As函数的行为类似于类型声明。 通常,最好使用error.is或errors.As,因为这些函数将在单个调用中检查整个链。 Wrapping errors with %w 如前所述,通常使用fmt.Errorf函数将其他信息添加到错误中。 if err !

    70810发布于 2020-07-27
  • 来自专栏乐享123

    Udp Packet Receive Errors

    Issue netstat -s output shows high number of Udp: packet receive errors Getting high number of UDP packet Resolution Udp: packet receive errors is increased for the following reasons: Not enough socket buffer 559933412 packets received 71 packets to unknown port received. 33861296 packet receive errors sysctl net.core.rmem_default This can be confirmed by watching socket statistics whilst packet receive errors Conclusion The statistic Udp: packet receive errors is reporting the SNMP MIB called UDP_MIB_INERRORS

    4.1K50发布于 2018-06-04
  • 来自专栏计算机视觉理论及其实现

    tf.errors.OpError

    参考   tf.errors - 云+社区 - 腾讯云 Class OpError A generic error that is raised when TensorFlow execution fails Aliases: Class tf.compat.v1.OpError Class tf.compat.v1.errors.OpError Class tf.compat.v2.errors.OpError Whenever possible, the session will raise a more specific subclass of OpError from the tf.errors module In that case, this will return None, and you should instead use the tf.errors.OpError.node_def to discover

    44610编辑于 2022-06-06
  • 来自专栏Java学习123

    Errors occurred during the build.

    最近在用eclipse,突然有一天开始,老报错:Errors occurred during the build. 百思不得其解,以为是配置文件崩溃了,后来查了下,发现答案如下: 编译时经常出现: Errors occurred during the build. Errors running builder 'JavaScript Validator' on project 'PMCnew'.

    99640发布于 2018-05-16
  • 来自专栏敏而好学

    修复zpool data errors错误

    see: http://illumos.org/msg/ZFS-8000-8A  scan: scrub repaired 0 in 0h0m with 1161 errors on Thu Apr : Permanent errors have been detected in the following files:        /tank/new/ddd/Oracle Solaris 11 see: http://illumos.org/msg/ZFS-8000-8A  scan: scrub repaired 0 in 0h0m with 1161 errors on Thu Apr see: http://illumos.org/msg/ZFS-8000-8A  scan: scrub repaired 0 in 0h0m with 1161 errors on Thu Apr see: http://illumos.org/msg/ZFS-8000-8A  scan: scrub repaired 0 in 0h0m with 1161 errors on Thu Apr

    2.3K30发布于 2020-02-11
  • 来自专栏Node Python Go全栈开发

    Go Errors 错误处理

    1.13 版本的改进是: 新增方法 errors.Unwrap : func Unwrap(err error) error 新增方法 errors.Is : func Is(err, target 使用 errors.Is 和 errors.As 方法检查错误: errors.Is 方法检查值: if errors.Is(err, ErrNotFound) { // something wasn't found } errors.As 方法检查特定错误类型: var e *QueryError if errors.As(err, &e) { // err is a *QueryError , and e is set to the error's value } errors.Is 方法会对嵌套的情况展开判断,这意味着: if e, ok := err. return fmt.Errorf("错误上下文 %v: %w", name, err) } 一旦使用 %w 进行了关联,就可以使用 errors.Is 和 errors.As 方法了: err

    1.4K30发布于 2020-07-19
  • 来自专栏Pythonista

    Golang之定义错误(errors

    基本示例: package main //定义错误 //error 也是个接口 import ( "errors" "fmt" ) var errNotFound error = errors.New

    61410发布于 2018-08-31
  • 来自专栏python前行者

    pymongo.errors.CursorNotFound: Cursor not found

    先从数据库中取得所有数据 db[‘test’].find({},{_id:0}),然后对结果进行for循环

    1.8K20发布于 2019-03-25
  • 来自专栏JNing的专栏

    git: non-fast-forward errors

    该方案解决了我遇到的 non-fast-forward errors 问题。

    1.7K50发布于 2018-09-28
  • 来自专栏自动化、性能测试

    FastAPI(27)- Handling Errors 处理错误

    服务器错误;这意味着就是服务端代码有问题 正常来说,客户端看不到 ValidationError 是正确的,因为这可能会暴露安全漏洞 报错后,控制台输出 raise ValidationError(errors

    1.5K10发布于 2021-09-27
  • 来自专栏johnhuster

    Eclipse执行junit测试时出现Errors occurred during the build. Errors running builder Integrated External Too

    执行单元测试时出现“Errors occurred during the build. Errors running builder 'Integrated External Tool Builder' on project 'xx'.

    1.1K10编辑于 2022-03-28
  • 来自专栏张善友的专栏

    WCF采用 netTcpBinding 发生的Socket errors

    最近在项目中采用 Windows service 作为WCF services的宿主, 在服务和客户端的调用上没有发生如何的异常和错误,但是经常发生下述错误: “System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded b

    54390发布于 2018-01-31
领券