aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/include/any-darwin-any/xpc/rich_error.h
blob: c61f5f1c80c03878130f756c429e7f1f3ef63ba2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __XPC_RICH_ERROR_H__
#define __XPC_RICH_ERROR_H__

#ifndef __XPC_INDIRECT__
#error "Please #include <xpc/xpc.h> instead of this file directly."
// For HeaderDoc.
#include <xpc/base.h>
#endif // __XPC_INDIRECT__

#ifndef __BLOCKS__
#error "XPC Rich Errors require Blocks support."
#endif // __BLOCKS__

XPC_ASSUME_NONNULL_BEGIN
__BEGIN_DECLS

#pragma mark Properties
/*!
 * @function xpc_rich_error_copy_description
 * Copy the string description of an error.
 *
 * @param error
 * The error to be examined.
 *
 * @result
 * The underlying C string for the provided error. This string should be
 * disposed of with free(3) when done.
 * 
 * This will return NULL if a string description could not be generated.
 */
XPC_EXPORT XPC_WARN_RESULT
char * _Nullable
xpc_rich_error_copy_description(xpc_rich_error_t error);

/*!
 * @function xpc_rich_error_can_retry
 * Whether the operation the error originated from can be retried.
 *
 * @param error
 * The error to be inspected.
 *
 * @result
 * Whether the operation the error originated from can be retried.
 */
XPC_EXPORT XPC_WARN_RESULT
bool
xpc_rich_error_can_retry(xpc_rich_error_t error);

__END_DECLS
XPC_ASSUME_NONNULL_END

#endif // __XPC_RICH_ERROR_H__