Commit 3848d6e4 authored by Andrei Mondoc's avatar Andrei Mondoc
Browse files

render error message in preview

parent bceabb74
...@@ -136,7 +136,7 @@ class CiviCRM_Gutenberg_Blocks { ...@@ -136,7 +136,7 @@ class CiviCRM_Gutenberg_Blocks {
], ],
'editor_script' => 'civicrm-gutenberg-blocks', // The script name we gave in the wp_register_script() call. 'editor_script' => 'civicrm-gutenberg-blocks', // The script name we gave in the wp_register_script() call.
'render_callback' => [ $this, 'block_render' ], 'render_callback' => [ $this, 'block_render' ],
] ); ] );
/** /**
* May be extended to wp_set_script_translations( 'my-handle', 'my-domain', * May be extended to wp_set_script_translations( 'my-handle', 'my-domain',
...@@ -311,8 +311,8 @@ class CiviCRM_Gutenberg_Blocks { ...@@ -311,8 +311,8 @@ class CiviCRM_Gutenberg_Blocks {
'CiviContribute', 'CiviContribute',
CRM_Core_Action::ADD CRM_Core_Action::ADD
) )->run(); ) )->run();
} catch (Exception $e) { } catch ( Exception $e ) {
// silence return $e->getMessage();
} }
return ob_get_clean(); return ob_get_clean();
...@@ -339,12 +339,12 @@ class CiviCRM_Gutenberg_Blocks { ...@@ -339,12 +339,12 @@ class CiviCRM_Gutenberg_Blocks {
try { try {
if ( $atts['action'] == 'register' ) { if ( $atts['action'] == 'register' ) {
( new CRM_Event_Controller_Registration() )->run(); ( new CRM_Event_Controller_Registration )->run();
} else { } else {
( new CRM_Event_Page_EventInfo )->run(); ( new CRM_Event_Page_EventInfo )->run();
} }
} catch ( Exception $e ) { } catch ( Exception $e ) {
// silence return $e->getMessage();
} }
return ob_get_clean(); return ob_get_clean();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment