aboutsummaryrefslogblamecommitdiffstats
path: root/README
blob: 9b14e0d1a3cb9f7801415cb63d72d693605588fd (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                              

                                                                 



                                                              

                                                        




                            
                                                 

                          
                                                 

                                







                                                                  



                                                             
                                                        





                                                               

                      
                                                               

                    
                                                            
A library that provides a single interface for error handling.
Specifically this is intended for cases where some errors are
errno errors or other libc errors and there are library-specific,
maybe for multiple libraries, errors.

The errors are thread-local, support error description, error
source string (which function failed), and error code with
error code group (e.g. "errno", "addrinfo" or a library name),
as well as cause chains, extended details, and if linked
together with liberror-backtrace, backtraces.


The important functions are:

	liberror_get_error
		Get error for the calling thread.

	liberror_set_error
		Set error for the calling thread.

	liberror_set_error_errno
		Wrapper for liberror_set_error for errno errors.

	liberror_set_error_existing
		Set error for the calling thread to a saved error.

	liberror_pop_error
		Set error for the calling thread to the
		current error's cause.

	liberror_reset_error
		Remove error for the calling thread, needed
		because `liberror_set_error` otherwise stores
		the error as the cause of the new error.

	liberror_print_error
		Print the error for the calling thread, include
		its backtrace if liberror-backtrace is also
		linked, the errors cause, and optionally remove
		the error for the calling thread.

	liberror_start
		Shall be called when entering a signal handler.

	liberror_end
		Shall be called when a signal handler exits.