|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## 0.4.5 |
| 4 | + |
| 5 | +### Changed |
| 6 | + |
| 7 | +- `error/0` is now `{error, error_reason()}` where `error_reason/0` |
| 8 | + is a documented sum type — was `{error, term()}`, which gave |
| 9 | + dialyzer nothing to check at call sites. The sum covers: |
| 10 | + |
| 11 | + - `marina_pool_not_started` and `timeout` (marina-level) |
| 12 | + - `cql_error()` — `{Code :: pos_integer(), Msg :: binary()}`, the |
| 13 | + Cassandra/Scylla server-side error tuple |
| 14 | + - `no_server`, `pool_not_started`, `shackle_not_started` (shackle |
| 15 | + errors that propagate through marina) |
| 16 | + |
| 17 | + `cql_error/0` is exported as a public type so callers can pattern- |
| 18 | + match against it cleanly. |
| 19 | + |
| 20 | +- `marina_body:decode/1` spec corrected: was `{error, atom()}`, |
| 21 | + is actually `{error, cql_error()}` — the `{Code, Msg}` shape was |
| 22 | + documented but the spec contradicted it. Real bug; dialyzer |
| 23 | + was silently accepting `atom()` because no caller was destructuring. |
| 24 | + |
| 25 | +- Four `marina_types` spec corrections (real correctness bugs, not |
| 26 | + just imprecision): |
| 27 | + |
| 28 | + - `decode_short_bytes/1` and `decode_string/1` can return |
| 29 | + `{null, binary()}` on the 0xFFFF sentinel; specs claimed |
| 30 | + `{binary(), binary()}`. |
| 31 | + - `encode_bytes/1` and `encode_short_bytes/1` accept `null` as |
| 32 | + input (encoded as the sentinel); specs claimed `binary()` only. |
| 33 | + |
| 34 | + No behavioural change — the functions handled `null` correctly |
| 35 | + already, the specs just lied about it. |
| 36 | + |
| 37 | +No source changes beyond the type tightening; existing callers |
| 38 | +continue to work unchanged. Dialyzer now flags `{error, typo}` |
| 39 | +at call sites that don't match the sum. |
| 40 | + |
3 | 41 | ## 0.4.4 |
4 | 42 |
|
5 | 43 | ### Added |
|
0 commit comments