Commit 6d7679d
committed
fix potential panic in IsRecoverable
The way `unrecoverableError` wraps an error can lead to potential
panics. In `IsRecoverable`, an `unrecoverableError` is passed to
`errors.Is` without an embedded error. This is problematic because any
error type that implements the `Is` interface and expects to be able to
call `Error()` will trigger a panic due to the embedded error being
`nil`.
To fix this, we can implement `Error()` on `unrecoverableError` and
handle the case where the embedded error is nil.1 parent a9809a7 commit 6d7679d
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
305 | 312 | | |
306 | 313 | | |
307 | 314 | | |
| |||
0 commit comments