Error types for ExDataSketch.
All recoverable errors are represented as structs implementing the Exception
behaviour. Functions that validate external input return tagged tuples:
{:ok, result} | {:error, %ErrorType{}}.
Error Types
NotImplementedError-- operation is stubbed and not yet implemented.InvalidOptionError-- an option value is out of range or of wrong type.DeserializationError-- binary data could not be decoded.IncompatibleSketchesError-- sketches cannot be merged due to parameter mismatch.UnsupportedOperationError-- operation not supported by a structure.InvalidChainCompositionError-- invalid FilterChain stage composition.
Summary
Functions
Wraps an error struct in an error tuple.
Raises a NotImplementedError for the given module and function name.
Wraps a value in an ok tuple.
Functions
@spec error(Exception.t()) :: {:error, Exception.t()}
Wraps an error struct in an error tuple.
Examples
iex> ExDataSketch.Errors.error(%ExDataSketch.Errors.InvalidOptionError{message: "bad"})
{:error, %ExDataSketch.Errors.InvalidOptionError{message: "bad"}}
Raises a NotImplementedError for the given module and function name.
Examples
iex> try do
...> ExDataSketch.Errors.not_implemented!(ExDataSketch.HLL, "estimate")
...> rescue
...> e in ExDataSketch.Errors.NotImplementedError -> e.message
...> end
"ExDataSketch.HLL.estimate is not yet implemented"
Wraps a value in an ok tuple.
Examples
iex> ExDataSketch.Errors.ok(:value)
{:ok, :value}