First of all I am sorry to post this question here since I don't know where to post the question related to Groovy.Since it is much similar to JAVA i am posting it here.
I am trying to connect to a database in GROOVY and if it fails then it should display an appropriate message on the screen.The entire code I have put it in a try-catch block.When the connection to the db fails my control goes to the catch block and in that catch block I am displaying my custom error message.But alongwith the custom error message the exception raised while connecting to the db is also shown.I don't want this exception to be displayed to the user.
Does anyone have any idea why it is showing the exception too when I am not printing the exception raised?
An help would be appreciated.
Thanks in advance
Hussain
I am trying to connect to a database in GROOVY and if it fails then it should display an appropriate message on the screen.The entire code I have put it in a try-catch block.When the connection to the db fails my control goes to the catch block and in that catch block I am displaying my custom error message.But alongwith the custom error message the exception raised while connecting to the db is also shown.I don't want this exception to be displayed to the user.
Does anyone have any idea why it is showing the exception too when I am not printing the exception raised?
An help would be appreciated.
Thanks in advance
Hussain
Comment