Skip to content

Commit e62b4e2

Browse files
committed
Document marina error_reason/0 and cql_error/0 in README
A2 standardization shipped both types as exports in 0.4.5, but the README didn't enumerate them so callers had to peek at include/marina.hrl to find the atoms. Added an 'Errors' subsection under 'Usage' (alongside Query options) listing: - marina_pool_not_started, timeout - cql_error() = {pos_integer(), binary()} -- the server-side CQL error code + message tuple, linked to Cassandra's CQL error-codes documentation - no_server, pool_not_started, shackle_not_started Plus a one-liner that cql_error/0 is publicly exported for clean pattern-matching at call sites. The 0.4.6 tag (the latest from this session, on top of 0.4.5) moves forward to this commit so the hex publish includes the README updates. 0.4.5's commit stays where it is -- the README polish lands at the newer tag.
1 parent 7922c1d commit e62b4e2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ Asynchronous (return a `shackle:request_id()`, consume via `marina:receive_respo
115115
| `timeout` | `pos_integer()` | `1000` |
116116
| `values` | `[binary()]` | `undefined` |
117117

118+
### Errors
119+
120+
All `marina:*` calls return `{ok, term()} | {error, error_reason()}` where `error_reason/0` (exported, added in 0.4.5) enumerates:
121+
122+
- **`marina_pool_not_started`**, **`timeout`** — marina-level routing / wait errors.
123+
- **`cql_error()`**`{pos_integer(), binary()}`, the Cassandra/Scylla server-side error tuple. The integer is the [CQL error code](https://cassandra.apache.org/doc/latest/cassandra/developing/cql/error_codes.html); the binary is the server-supplied message.
124+
- **`no_server`**, **`pool_not_started`**, **`shackle_not_started`** — shackle-level errors that propagate through marina.
125+
126+
`cql_error/0` is exported as a public type so callers can pattern-match against the server-error shape cleanly.
127+
118128
## Architecture notes
119129

120130
- **Bootstrap.** Dial each `bootstrap_ip` in order, query `system.local` + `system.peers`, filter by the seed's datacenter, start one shackle pool per peer.

0 commit comments

Comments
 (0)