In this example, We have a function call inside try
statement and we have catch
block with statement that will print the error message. There is no defination of ShowMessage()
so call to this method will throw the error message. See the code snippet: