View Source GitHub.Error exception (GitHub REST API Client v0.0.1)
Exception struct used for communicating errors from the client
Note
Functions in this module is unlikely to be used directly by applications. Instead, they are useful for plugins. See
GitHub.Plugin
for more information.
This error covers errors generated by the client (for example, HTTP connection errors) as well as errors returned from the GitHub API (for example, Not Found errors).
fields
Fields
code
(integer): Status code of the API response, if a response was received.message
(string): Human-readable message describing the error.operation
(t:Operation.t/0
): Operation at the time of the error.source
(term): Cause of the error. This could be an operation, an API error response, or something else.stacktrace
(Exception.stacktrace/0
): Stacktrace from the time of the error.step
(plugin): Plugin active at the time of the error (expressed as a tuple containing the module and function).
Users of the library can match on the information in the code
and source
fields to extract
additional information.
Link to this section Summary
Link to this section Types
@type t() :: %GitHub.Error{ __exception__: true, code: integer() | nil, message: String.t(), operation: GitHub.Operation.t(), source: term(), stacktrace: Exception.stacktrace(), step: {module(), atom()} }
GitHub API client error
Link to this section Functions
Create a new error struct with the given fields
The current stacktrace is automatically filled in to the resulting error. Callers should specify
the status code
(if available), a message
, the original operation
, the source
of the
error, and which step
or plugin is currently active.