-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
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
当err为nil时,输出错误原因 #105
当err为nil时,输出错误原因 #105
Conversation
Signed-off-by: tianxuanhong <523713078@qq.com>
pkg/infra/proposer.go
Outdated
p.logger.Errorf("Err processing proposal: %s, status: %d, addr: %s \n", err, r.Response.Status, p.Addr) | ||
if r.Response.Status < 200 || r.Response.Status >= 400 { | ||
if err == nil{ | ||
p.logger.Errorf("Err processing proposal: %s \n",r.Response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢贡献
这里的case已经被原来76行覆盖了吧?即 err == nil && (r.Response.Status < 200 || r.Reponse.Status >= 400)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个修改是因为 #97 问题,我也遇到了,err为nil时,没看到错误原因。输出r.Response后类似未上传链码错误会输出:"status:500 message:cannot retrieve package for chaincode mycc/v2, error open /var/hyperledger/production/chaincodes/mycc.v2: no such file or directory", 可能会帮助一些遇到类似问题的人清楚问题原因。 原来76行的代码err ==nil &&(r.Response.Status < 200 || r.Reponse.Status >= 400)这个我没注意到是在哪次修改里,最新代码好像不是。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦我知道了,这里只需要在原来的76行,把 r.Response.Message
也打印出来,就ok了吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯~~好像也行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tianxuanhong 麻烦更新一下PR吧
Signed-off-by: tianxuanhong <523713078@qq.com>
Signed-off-by: tianxuanhong 523713078@qq.com