install_fatal_error_handler ‐ Installs a new error handler to be used whenever a serious (non‐recoverable) error is encountered by LLVM.

Synopsis

Declared in <llvm/Support/ErrorHandling.h>

void
install_fatal_error_handler(
    fatal_error_handler_t handler,
    void* user_data = nullptr);

Description

If no error handler is installed the default is to print the error message to stderr, and call exit(1). If an error handler is installed then it is the handler's responsibility to log the message, it will no longer be printed to stderr. If the error handler returns, then exit(1) will be called.

It is dangerous to naively use an error handler which throws an exception. Even though some applications desire to gracefully recover from arbitrary faults, blindly throwing exceptions through unfamiliar code isn't a way to achieve this.

Parameters

Name

Description

handler

‐ The fatal error handler to install.

user_data

‐ An argument which will be passed to the install error handler.

Created with MrDocs