getMessage(); // Repeat the message so it's easy to see in the logs } elseif (is_string($arg1)) { // First is message $message = $arg1; // Second, optional, is a cause if ($arg2 instanceof \Exception) { $cause = $arg2; } } // call Exception constructor parent::__construct($message, 0, $cause); } }