👩💻 Join our community of thousands of amazing developers!
The usual way of handling the exception is by requiring the catch block to catch the exception (thrown from the try block) to a variable like so. public function bar() { try { throw new Exception('foo!'); } catch (Exception $e) { return $e->getMessage(); } } Here, the exception is being catched in the catch block to a variable $e. This variable now holds any information regarding the exception such as exception message, code, trace, and so on. This is useful in logg...