Definition :
The getMessage()
method is used to returns a description of the error or behaviour that caused the exception to be thrown.
$exception->getMessage()
No parameter is required.
Returns the Exception message as a string.
Given below example throw an exception and then output its message:
Output : Found Error