Share this page

# Example: lr_fail_trans_with_error

In the following example, the status of transaction t1 is changed to fail because an error has occurred. The specific error string is returned by my_get_error_string and is formatted by lr_fail_trans_with_error as part of the message.

The exit status of transaction t2, which is not LR_AUTO, is unaffected by the call to lr_fail_trans_with_error and it remains LR_PASS.

    if (status != SUCCESS)
         lr_fail_trans_with_error("An error has occurred: %s", my_get_error_string(status));

    lr_end_transaction("t1", LR_AUTO);
    lr_end_transaction("t2", LR_PASS);

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: