Failure ADT + classifier + legacy-shape translator for hive-milvus.
Pure, no side effects: classifies Throwables into the closed
MilvusFailure ADT and translates ADT values back to the legacy
{:success? false :errors [...] :reconnecting? ...} map shape that
protocol callers expect. Classification delegates to
milvus-clj.client/classify-error (dispatch on the
::client/transport ex-data tag) and walks the full .getCause
chain, not just the top throwable.
Failure ADT + classifier + legacy-shape translator for hive-milvus.
Pure, no side effects: classifies Throwables into the closed
`MilvusFailure` ADT and translates ADT values back to the legacy
`{:success? false :errors [...] :reconnecting? ...}` map shape that
protocol callers expect. Classification delegates to
`milvus-clj.client/classify-error` (dispatch on the
`::client/transport` ex-data tag) and walks the full `.getCause`
chain, not just the top throwable.(->legacy-map failure)Translate a MilvusFailure ADT to the legacy fail-map shape expected by protocol callers:
{:success? false :errors [msg] :reconnecting? bool}
:reconnecting? is true for transient and reconnect-timeout variants, false for fatal.
Translate a MilvusFailure ADT to the legacy fail-map shape expected by
protocol callers:
{:success? false :errors [msg] :reconnecting? bool}
:reconnecting? is true for transient and reconnect-timeout variants,
false for fatal.(->milvus-failure kw__12196__auto__)Coerce a keyword to a MilvusFailure variant (no data fields). Returns nil if keyword is not a valid variant.
Coerce a keyword to a MilvusFailure variant (no data fields). Returns nil if keyword is not a valid variant.
Runtime shape of any MilvusFailure ADT value, covering all three variants.
Runtime shape of any MilvusFailure ADT value, covering all three variants.
(classify t)Classify a Throwable into a MilvusFailure ADT value.
Walks the .getCause chain and returns :milvus/transient when
ANY link classifies as transient — either through the
::client/transport-tagged milvus-clj.client/classify-error
dispatch (:connection-failure / :retryable) or through the
legacy message-marker fallback. Otherwise :milvus/fatal.
Walking the chain matters because milvus-clj.api/* returns
futures; when hive-milvus derefs them, a transport-thrown
ex-info tagged {::client/transport :http :cause :io} resurfaces
wrapped in java.util.concurrent.ExecutionException, whose own
ex-data is empty. Only by inspecting the cause do we see the tag
and route the failure to the heal loop instead of re-throwing.
The resulting ADT value's :message preserves the top throwable's
message for legacy-shape continuity. Returns a MilvusFailure,
never throws.
Classify a Throwable into a MilvusFailure ADT value.
Walks the `.getCause` chain and returns `:milvus/transient` when
ANY link classifies as transient — either through the
`::client/transport`-tagged `milvus-clj.client/classify-error`
dispatch (`:connection-failure` / `:retryable`) or through the
legacy message-marker fallback. Otherwise `:milvus/fatal`.
Walking the chain matters because `milvus-clj.api/*` returns
`future`s; when hive-milvus derefs them, a transport-thrown
`ex-info` tagged `{::client/transport :http :cause :io}` resurfaces
wrapped in `java.util.concurrent.ExecutionException`, whose own
ex-data is empty. Only by inspecting the cause do we see the tag
and route the failure to the heal loop instead of re-throwing.
The resulting ADT value's `:message` preserves the top throwable's
message for legacy-shape continuity. Returns a `MilvusFailure`,
never throws.Legacy fail-map shape returned to protocol callers: {:success? false :errors [msg] :reconnecting? bool}.
Legacy fail-map shape returned to protocol callers:
{:success? false :errors [msg] :reconnecting? bool}.(milvus-failure variant-kw__12193__auto__)(milvus-failure variant-kw__12193__auto__ data__12194__auto__)Construct a MilvusFailure variant. (milvus-failure variant-keyword) for enum variants (milvus-failure variant-keyword data-map) for data variants
Throws ex-info for unknown variants.
Construct a MilvusFailure variant. (milvus-failure variant-keyword) for enum variants (milvus-failure variant-keyword data-map) for data variants Throws ex-info for unknown variants.
(milvus-failure? x__12195__auto__)True if x is a MilvusFailure ADT value.
True if x is a MilvusFailure ADT value.
Closed sum type of failure modes observed while talking to Milvus.
Closed sum type of failure modes observed while talking to Milvus.
Malli :multi schema (dispatch :adt/variant) for MilvusFailure — generator-capable and EDN-safe wherever pred-sym->malli covers the declared field predicates.
Malli :multi schema (dispatch :adt/variant) for MilvusFailure — generator-capable and EDN-safe wherever pred-sym->malli covers the declared field predicates.
Runtime shape of the MilvusFailure ADT value returned by classify.
Runtime shape of the MilvusFailure ADT value returned by classify.
(reconnect-timeout message)Construct a :milvus/reconnect-timeout failure with the given message.
Construct a :milvus/reconnect-timeout failure with the given message.
Runtime shape of the :milvus/reconnect-timeout MilvusFailure variant.
Runtime shape of the :milvus/reconnect-timeout MilvusFailure variant.
(transient? failure)True if failure is a :milvus/transient variant.
True if failure is a :milvus/transient variant.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |