Skip to main content

Module error_c

Module error_c 

Source
Expand description

C FFI error handling.

This module provides thread-local error storage and extern "C" functions for retrieving and clearing error information from C code:

  • diffsol_error_code — returns DIFFSOL_OK, DIFFSOL_ERR, or DIFFSOL_BAD_ARG.
  • diffsol_last_error_message — returns a pointer to the last error message.
  • diffsol_last_error_file / diffsol_last_error_line — return the source location of the last error.
  • diffsol_clear_last_error — clears the thread-local error state.

Functions§

diffsol_clear_last_error
Clear the last error for the current thread.
diffsol_error
Return the last error message for the current thread, if any.
diffsol_error_code
Return whether thread-local error state is currently set.
diffsol_last_error_file
Return the source file associated with the last error for the current thread.
diffsol_last_error_line
Return the source line associated with the last error for the current thread.
diffsol_last_error_message
Return the last error message for the current thread, if any.