Fatal Error triggers Before WP_Error handler

Question

I have this code :

// this will provoke a fatal error because "Grap" without last "h"
$graph = new CanvasGrap(300,100);
if ( is_wp_error($graph) ){ echo "is wp_error"; }

Situation :

  1. the echo is never showed.
  2. wordpress crash.

Goals :

  1. How do I prevent that like a misspelling error crash wordpress?
  2. Why the message it’s not showed ?
  3. How do I must code this specific situation to see my custom error message?
0
, Zyncho 4 years 2020-02-12T08:41:19-05:00 0 Answers 41 views 0

Leave an answer

Browse
Browse