# sd_bus_reply_method_error

## NAME



           sd_bus_reply_method_error, sd_bus_reply_method_errorf,
           sd_bus_reply_method_errorfv, sd_bus_reply_method_errno,
           sd_bus_reply_method_errnof, sd_bus_reply_method_errnofv - Reply
           with an error to a D-Bus method call
    


## SYNOPSIS



           **#include <systemd/sd-bus.h>**
    
           **int sd_bus_reply_method_error(sd_bus_message ***_call_**,**
                                         **const sd_bus_error ***_e_**);**
    
           **int sd_bus_reply_method_errorf(sd_bus_message ***_call_**,**
                                          **const char ***_name_**,**
                                          **const char ***_format_**, ...);**
    
           **int sd_bus_reply_method_errorfv(sd_bus_message ***_call_**,**
                                           **const char ***_name_**,**
                                           **const char ***_format_**, va_list** _ap_**);**
    
           **int sd_bus_reply_method_errno(sd_bus_message ***_call_**, int** _error_**,**
                                         **const sd_bus_error ***_p_**);**
    
           **int sd_bus_reply_method_errnof(sd_bus_message ***_call_**, int** _error_**,**
                                          **const char ***_format_**, ...);**
    
           **int sd_bus_reply_method_errnofv(sd_bus_message ***_call_**, int** _error_**,**
                                           **const char ***_format_**, va_list** _ap_**);**
    


## DESCRIPTION



           The **sd_bus_reply_method_error()** function sends an error reply to
           the _call_ message. The error structure _e_ specifies the error to
           send, and is used as described in
           sd_bus_message_new_method_error(3). If no reply is expected to
           _call_ , this function succeeds without sending a reply.
    
           The **sd_bus_reply_method_errorf()** is to **sd_bus_reply_method_error()**
           what **sd_bus_message_new_method_errorf()** is to
           **sd_bus_message_new_method_error()**.
    
           The **sd_bus_reply_method_errno()** is to **sd_bus_reply_method_error()**
           what **sd_bus_message_new_method_errno()** is to
           **sd_bus_message_new_method_error()**.
    
           The **sd_bus_reply_method_errnof()** is to **sd_bus_reply_method_error()**
           what **sd_bus_message_new_method_errnof()** is to
           **sd_bus_message_new_method_error()**.
    


## RETURN VALUE



           This function returns a non-negative integer if the error reply
           was successfully sent or if _call_ does not expect a reply. On
           failure, it returns a negative errno-style error code.
    
       **Errors**
           Returned errors may indicate the following problems:
    
           **-EINVAL**
               The input parameter _call_ is **NULL**.
    
               Message _call_ is not a method call message.
    
               Message _call_ is not attached to a bus.
    
               The error parameter _e_ to **sd_bus_reply_method_error()** is not
               set, see sd_bus_error_is_set(3).
    
           **-EPERM**
               Message _call_ has been sealed.
    
           **-ENOTCONN**
               The bus to which message _call_ is attached is not connected.
    
           **-ENOMEM**
               Memory allocation failed.
    
           In addition, any error returned by sd_bus_send(3) may be returned.
    


## NOTES



           Functions described here are available as a shared library, which
           can be compiled against and linked to with the
           **libsystemd pkg-config**(1) file.
    
           The code described here uses getenv(3), which is declared to be
           not multi-thread-safe. This means that the code calling the
           functions described here must not call setenv(3) from a parallel
           thread. It is recommended to only do calls to **setenv()** from an
           early phase of the program when no other threads have been
           started.
    


* * *