Aranya
a software development tool for governing access to data and services over a decentralized, zero-trust framework with secure end-to-end encrypted data exchange built-in.
Loading...
Searching...
No Matches
Related Symbols
AranyaExtError Struct Reference

Functions suffixed with _ext accept an extra struct AranyaExtError *ext_err parameter for extended error information. More...

#include <aranya-client.h>

Related Symbols

(Note that these are not member symbols.)

AranyaError aranya_ext_error_init (struct AranyaExtError *out)
 Initializes AranyaExtError.
 
AranyaError aranya_ext_error_cleanup (struct AranyaExtError *ptr)
 Releases any resources associated with ptr.
 
AranyaError aranya_ext_error_msg (const struct AranyaExtError *err, char *msg, size_t *msg_len)
 Copies the extended error's message into msg.
 
AranyaError aranya_ext_error_msg_ext (const struct AranyaExtError *err, char *msg, size_t *msg_len, struct AranyaExtError *__ext_err)
 Copies the extended error's message into msg.
 

Detailed Description

Functions suffixed with _ext accept an extra struct AranyaExtError *ext_err parameter for extended error information.

Example:

struct AranyaExtError ext_err;
AranyaError rc = aranya_get_device_id_ext(client, &id, &ext_err);
size_t len = 0;
aranya_ext_error_msg(&ext_err, NULL, &len);
char *buf = malloc(len);
aranya_ext_error_msg(&ext_err, buf, &len);
// `buf` now holds the detailed error message
}
@ ARANYA_ERROR_SUCCESS
Success.
Definition aranya-client.h:134

Friends And Related Symbol Documentation

◆ aranya_ext_error_cleanup()

AranyaError aranya_ext_error_cleanup ( struct AranyaExtError ptr)
related

Releases any resources associated with ptr.

ptr must either be null or initialized by aranya_ext_error_init.

◆ aranya_ext_error_init()

AranyaError aranya_ext_error_init ( struct AranyaExtError out)
related

Initializes AranyaExtError.

When no longer needed, out's resources must be released with its cleanup routine.

◆ aranya_ext_error_msg()

AranyaError aranya_ext_error_msg ( const struct AranyaExtError err,
char *  msg,
size_t *  msg_len 
)
related

Copies the extended error's message into msg.

If msg_len is large enough to fit the entire message, including the trailing null byte, it updates msg_len with the length of the message and copies the message into msg.

Otherwise, if msg_len is not large enough to fit the entire message, including the trailing null byte, it updates msg_len with the length of the message and returns ARANYA_ERROR_BUFFER_TOO_SMALL.

Parameters
[in]errthe error to get a message for.
[out]msgbuffer to copy error message into.
[in,out]msg_lenlength of the message buffer.

◆ aranya_ext_error_msg_ext()

AranyaError aranya_ext_error_msg_ext ( const struct AranyaExtError err,
char *  msg,
size_t *  msg_len,
struct AranyaExtError __ext_err 
)
related

Copies the extended error's message into msg.

If msg_len is large enough to fit the entire message, including the trailing null byte, it updates msg_len with the length of the message and copies the message into msg.

Otherwise, if msg_len is not large enough to fit the entire message, including the trailing null byte, it updates msg_len with the length of the message and returns ARANYA_ERROR_BUFFER_TOO_SMALL.

Parameters
[in]errthe error to get a message for.
[out]msgbuffer to copy error message into.
[in,out]msg_lenlength of the message buffer.

The documentation for this struct was generated from the following file: