Site icon Hip-Hop Website Design and Development

Using Formidable Forms plugin, how to handle errors/exceptions in the frm_after_create_entry hook? [closed]

I’m using the Formidable Forms plugin. I’ve created a form and added it to a page. The form id is 2.
Per this link, I’m using the frm_after_create_entry hook to do some extra processing.

add_action('frm_after_create_entry', 'yourfunctionname', 30, 2);
function yourfunctionname($entry_id, $form_id)
{

    if ($form_id == 2) {  //customer log in form

        $registration_data = new RegistrationData();

        if (isset($_POST['item_meta'][7]))
            $registration_data->email = $_POST['item_meta'][7];

        if (isset($_POST['item_meta'][6]))
            $registration_data->productCode = $_POST['item_meta'][6];

        if (isset($_POST['item_meta'][8]))
            $registration_data->lastFourCreditCard = $_POST['item_meta'][8]; 

        //returns a WP_Error object
        $return = register($registration_data);
    
    }
}

How can I get the form to display the error message?

Currently I have the register method returning a WP_Error to see if that would do anything – it does not. It still gives me the default form success message:

I’ve also tried throwing a new Exception but that just gives me the standard WordPress error screen with the details of the Exception.

The documents don’t seem to address error handling at all.