HaveCodeError can panic
Closed this issue · 2 comments
didil commented
I think this type assertion should use a safe type assertion
serr,ok := err.(*RequestError)
as it currently stands if I do a downstream error check using HaveCodeError and it's not a RequestError it panics.
I could do the .(*RequestError) check downstream but the general Go guideline is that library code shouldn't panic ...
Other than that thanks for this helpful library !
pioz commented
Thanks for reporting this issue. You are right! I've fixed the problem with this commit. Can you check on master if the problem is really fixed?
didil commented
great thanks !