We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好, 我遇到一个问题, Stream.Read 返回的 EOF 是 errors.WithStack 包装后 的, 导致和其他一些库使用时得到错误的判断, 如: reverseproxy.go 是设计有误, 还是我用的方法错了?
Stream.Read
EOF
errors.WithStack
The text was updated successfully, but these errors were encountered:
你可以用 err.Cause()获得topmost error https://godoc.org/github.com/pkg/errors#Cause
Sorry, something went wrong.
可是和其他接口合作时它们接收到一个非 EOF 错误, 就会做一些其他处理(比如 error 日志输出, 提前返回等).
如上面的 net/http/httputil/reverseproxy 在遇到非 EOF 错误时就会输出 error 日志, 继而 panic 根本没有机会获取 err.Cause().
err.Cause()
你可以wrap一下,接口桥接, 但reverseproxy直接判定io.EOF,可以说是相当大胆的写法。
No branches or pull requests
你好, 我遇到一个问题,
Stream.Read
返回的EOF
是errors.WithStack
包装后 的, 导致和其他一些库使用时得到错误的判断,如: reverseproxy.go
是设计有误, 还是我用的方法错了?
The text was updated successfully, but these errors were encountered: