|
NATS_EXTERN microError * | micro_Errorf (const char *format,...) |
| creates a new microError, with a printf-like formatted message. More...
|
|
NATS_EXTERN microError * | micro_ErrorfCode (int code, const char *format,...) |
| creates a new microError, with a code and a printf-like formatted message. More...
|
|
NATS_EXTERN microError * | micro_ErrorFromStatus (natsStatus s) |
| Wraps a NATS status into a microError, if not a NATS_OK. More...
|
|
NATS_EXTERN int | microError_Code (microError *err) |
| returns the int code of the error. More...
|
|
NATS_EXTERN void | microError_Destroy (microError *err) |
| destroys a microError. More...
|
|
NATS_EXTERN natsStatus | microError_Status (microError *err) |
| Returns the NATS status associated with the error. More...
|
|
NATS_EXTERN const char * | microError_String (microError *err, char *buf, size_t len) |
| Returns a printable string with the error message. More...
|
|
NATS_EXTERN microError * | microError_Wrapf (microError *err, const char *format,...) |
| Wraps an exising microError with a higher printf-like formatted message. More...
|
|
Functions that create and manipulate microError.
◆ microError_Ignore
◆ micro_Errorf()
- Note
- Errors must be freed with microError_Destroy, but often they are simply returned up the call stack.
- Parameters
-
format | printf-like format. |
- Returns
- a new microError or micro_ErrorOutOfMemory.
◆ micro_ErrorfCode()
- Note
- Errors must be freed with microError_Destroy, but often they are simply returned up the call stack.
- Parameters
-
code | an int code, loosely modeled after the HTTP status code. |
format | printf-like format. |
- Returns
- a new microError or micro_ErrorOutOfMemory.
◆ micro_ErrorFromStatus()
- Parameters
-
s | NATS status of receiving the response. |
- Returns
- a new microError or
NULL
if no error if found.
◆ microError_Code()
- Parameters
-
- Returns
- the int code.
◆ microError_Destroy()
◆ microError_Status()
- Parameters
-
- Returns
- the status
◆ microError_String()
This function outputs into a user-provided buffer, and returns a "`%s`-able" pointer to it.
- Parameters
-
err | the error. |
buf | the output buffer. |
len | the capacity of the output buffer. |
- Returns
buf
◆ microError_Wrapf()
- Warning
- The original error may be freed and should not be refered to after having been wrapped.
- Parameters
-
err | the original error |
format | the new message to prepend to the original error message. |
... | |
- Returns
- a new, wrapped, error.