View Source Aptos.Client.Result (Aptos v0.2.4)

The Result type holds information from API calls to an Aptos node.

Possible results are:

  • {:ok, headers, body}
  • {:error, :bad_status, http_status_code, error_info_provided_by_api_endpoint}

Since we are using Tesla, we may also get:

  • {:error, tesla_error}

Link to this section Summary

Link to this section Types

@type err() :: {:error, :bad_status, pos_integer(), error_info()}
@type error_info() :: %{
  message: String.t(),
  error_code: String.t(),
  vm_error_code: integer()
}
@type from_tesla() :: t() | {:error, any()}
@type ok() :: {:ok, keyword(), any()}
@type t() :: ok() | err()

Link to this section Functions

@spec from_response(Tesla.Env.t()) :: t()
@spec from_tesla(Tesla.Env.result()) :: from_tesla()