Commit c97dcb3
committed
Handle potential null return codes in
The `GetReturnCode()` method assumes that the operation it is applied to will return a `@ReturnCode` (or a parameter corresponding to the `sqlParameter` parameter). If the operation doesn't return one, an unintuitive and unexpected exception is thrown.
This is mitigated in this commit by instead falling back to a generic error code of `-1`. This addresses, for instance, a bug where the `GetTopicId()` function wasn't returning a value if the `@TopicKey` parameter couldn't be found. That bug has since been fixed (d517971)—but we should be setup to handle that potentiality regardless. This also provides flexibility for databases that haven't updated `GetTopicId()` yet.GetReturnCode()
1 parent d517971 commit c97dcb3
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
0 commit comments