EasyRpc.RpcError (EasyRpc v0.6.0)

View Source

RPC error for EasyRpc.

This module is kept for backward compatibility and delegates to EasyRpc.Error.

Examples

iex> EasyRpc.RpcError.raise_error("Connection failed")
** (EasyRpc.Error) [EasyRpc.Error:rpc_error] Connection failed

Summary

Functions

Logs the error using Logger.

Prints the error to stdout.

Raises an RPC error.

Functions

log_error(error)

@spec log_error(EasyRpc.Error.t() | term()) :: :ok

Logs the error using Logger.

Examples

error = EasyRpc.Error.rpc_error("Connection failed")
EasyRpc.RpcError.log_error(error)

print(error)

@spec print(EasyRpc.Error.t()) :: :ok

Prints the error to stdout.

Examples

error = EasyRpc.Error.rpc_error("Connection failed")
EasyRpc.RpcError.print(error)

raise_error(message)

@spec raise_error(String.t() | term()) :: no_return()

Raises an RPC error.

Examples

EasyRpc.RpcError.raise_error("Connection refused")
EasyRpc.RpcError.raise_error({:error, :nodedown})