How do we debug what went in wrong in the libraries that we use with "return error instead of throwing exception" model?

xiaomaoge · · 587 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

I'm faced with a little challenge today. I'm using a library which ultimately uses sycalls to do the stuff. If a syscall fails, it returns with an error obtained from the syscall itself. As these errors come from the native apis (like winapi?), they are sometimes generic (like system cannot find path specified). If they are from go code/library code itself I can just do a find on the files of interest. But how can I know exactly which line returned in the call stack with that error without some kind of mechanism. runtime.Stack() is not an option since we are talking about the existing library code. Any ideas?

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

587 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传