Commit ed09cea
committed
fix recognizing InvalidEventError in handleFailedGoError
Fixing an issue caused by the fact that I have no idea what I'm doing in Go.
fsm.InvalidEventError implements Error() with a value receiver, which actually allows to provide an error as a value or as a pointer.
However, errors.As() is not smart about it and does not strip the type from references/pointers/etc, so the original version would work only with errors passed as pointers.
This commit modifies the helper to work correctly with errors provided as values, which is the more natural way to use it.
Unfortunately it is not possible to prevent a caller from passing an error pointer.
Let's consider it as a part of OCTRL-1064.1 parent e3283bd commit ed09cea
2 files changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | | - | |
39 | | - | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | | - | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments