Doubt about Exceptions

0

I'm doing a PHP course online, and I'm in a videotape that talks about error handling, in this video lesson some custom errors were created, and after the code was created, these errors occurred to demonstrate the generated message. My question is regarding the display of this error message that was generated, in the video lesson I am instructed to use:

catch(Exception $e){ $e->getMessage()}

But using that way, I do not get any messages, and in the video lesson the custom error message appears, as well as other details about the error, such as the line that the error occurs, for example.

The only way the custom error I created to display your message is by using:

catch(Exception $e){echo $e->getMessage()}

In this way the custom error message that I created is displayed, but only it does not show other details of the error as it appears in the video lesson.

Is this occurring normal? I find it strange because my code is exactly the same as the teacher and this difference is occurring in the display of the errors.

    
asked by anonymous 10.03.2017 / 02:44

0 answers