#[non_exhaustive]
pub enum ErrorCode {
    Success,
    ApiNotAvailable,
    InternalError,
    InvalidArguments,
    NotFound,
    Unavailable,
    HttpRequestFailed,
}
Expand description

Error return codes for API functions.

Note that there is an ErrorCode::Success, so the presence of ErrorCode does NOT signify an error.

Do NOT use this type in the public interface of ark-api. Use idiomatic Rust error enum or ark_api::Error instead

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Success

Success - there was no error and the operation completed successfully

§

ApiNotAvailable

API not available.

Typically happens if a module calls an API it has not specified that it requires

§

InternalError

Internal error - something went wrong on in the Ark host.

Such an error will cause a trap on the host, causing an unload of the module triggering it.

§

InvalidArguments

Invalid arguments - the inputs to the called API function were not valid

§

NotFound

Resource not found - used by APIs to indicate a requested resource can’t be found

§

Unavailable

The API or resource is currently not available

§

HttpRequestFailed

HTTP request failed due to external server error - something went wrong when communicating with the remote server

This can happen when sending a HTTP request to a server that is unavailable, if DNS lookup fails, or other server related issues.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.