Skir.RPC (skir_elixir_client v0.2.2)

Copy Markdown View Source

Native SkirRPC support for Elixir.

SkirRPC is a unary HTTP RPC protocol. Generated Skir.Method values can be registered with Skir.RPC.Service or invoked through Skir.RPC.ServiceClient.

Summary

Functions

Creates a controlled SkirRPC error that is safe to return to the client.

Returns whether the HTTP error status is supported by SkirRPC.

Creates an internal SkirRPC error whose message is hidden unless the service explicitly permits exposure.

Functions

error(status_code, message \\ nil)

@spec error(integer(), String.t() | nil) :: Skir.RPC.ServiceError.t()

Creates a controlled SkirRPC error that is safe to return to the client.

http_error_code?(code)

@spec http_error_code?(integer()) :: boolean()

Returns whether the HTTP error status is supported by SkirRPC.

unknown_error(message)

@spec unknown_error(String.t()) :: Skir.RPC.UnknownError.t()

Creates an internal SkirRPC error whose message is hidden unless the service explicitly permits exposure.