1SD_BUS_REPLY_METHOD_ERROR(3)sd_bus_reply_method_erroSrD_BUS_REPLY_METHOD_ERROR(3)
2
3
4
6 sd_bus_reply_method_error, sd_bus_reply_method_errorf,
7 sd_bus_reply_method_errno, sd_bus_reply_method_errnof - Reply with an
8 error to a method call
9
11 #include <systemd/sd-bus.h>
12
13 int sd_bus_reply_method_error(sd_bus_message *call,
14 const sd_bus_error *e);
15
16 int sd_bus_reply_method_errorf(sd_bus_message *call, const char *name,
17 const char *format, ...);
18
19 int sd_bus_reply_method_errno(sd_bus_message *call, int error,
20 const sd_bus_error *p);
21
22 int sd_bus_reply_method_errnof(sd_bus_message *call, int error,
23 const char *format, ...);
24
26 The sd_bus_reply_method_error() function sends an error reply to the
27 call message. The error structure e specifies the error to send, and is
28 used as described in sd_bus_message_new_error(3). If no reply is
29 expected to call, this function returns success without sending reply.
30
31 The sd_bus_reply_method_errorf() is to sd_bus_reply_method_error() what
32 sd_bus_message_new_method_errorf() is to
33 sd_bus_message_new_method_error().
34
35 The sd_bus_reply_method_errno() is to sd_bus_reply_method_error() what
36 sd_bus_message_new_method_errno() is to
37 sd_bus_message_new_method_error().
38
39 The sd_bus_reply_method_errnof() is to sd_bus_reply_method_error() what
40 sd_bus_message_new_method_errnof() is to
41 sd_bus_message_new_method_error().
42
44 These functions return 0 if the error reply was successfully sent or if
45 none was expected, and a negative errno-style error code otherwise.
46
47 Errors
48 Returned errors may indicate the following problems:
49
50 -EINVAL
51 The call message call is NULL.
52
53 Message call is not a method call message.
54
55 Message call is not attached to a bus.
56
57 The error error parameter to sd_bus_reply_method_error is not set,
58 see sd_bus_error_is_set(3).
59
60 -EPERM
61 Message call has been sealed.
62
63 -ENOTCONN
64 The bus to which message call is attached is not connected.
65
66 -ENOMEM
67 Memory allocation failed.
68
69 In addition, any error message returned by sd_bus_send(1) may be
70 returned.
71
73 These APIs are implemented as a shared library, which can be compiled
74 and linked to with the libsystemd pkg-config(1) file.
75
77 systemd(1), sd-bus(3), sd_bus_message_new_method_error(3)
78
79
80
81systemd 243 SD_BUS_REPLY_METHOD_ERROR(3)