Displaying PHP Errors from admin-ajax.php in Wordpress

Edit wp-includes/class-wp-fatal-error-handler.php and 

change this in display_default_error_template( $error, $handled ) (Line: 193):


$message = sprintf(

                        '<p>%s</p><p><a href="%s">%s</a></p>',

                        $message,

                        /* translators: Documentation explaining debugging in WordPress. */

                        __( 'https://wordpress.org/support/article/debugging-in-wordpress/' ),

                        __( 'Learn more about debugging in WordPress.' )

                );

to


$message = sprintf(

                        '<p>%s</p><p><a href="%s">%s</a></p>',

                        $message . ' ' . json_encode($error),

                        /* translators: Documentation explaining debugging in WordPress. */

                        __( 'https://wordpress.org/support/article/debugging-in-wordpress/' ),

                        __( 'Learn more about debugging in WordPress.' )

                );


Then preview HTML response to admin-ajax.php using Dev Tools.