473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Suppressing exception raised in Groovy

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
Mar 13 '08 #1
3 2458
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
Can you send a sample of your try catch block. I am of the feeling you are using the generic exeption error message appended with your custom one each time you display the error....

It is just a hunch. How do you find Groovy though? Is it worth moving to
Mar 13 '08 #2
sorry, I meant your Catch Block
Mar 13 '08 #3
Hi
This is the line for which it is displaying the exception on the screen and then going into the catch block.

Expand|Select|Wrap|Line Numbers
  1.     consConn.eachRow(consSql)
The above code is in the try block where it is throwing the exception and displaying on the screen before going into the catch block.


Regards,
Hussain
Mar 13 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: StepH | last post by:
Hi, I've this module : from optparse import OptionParser import re _version = "P1" def writeVar(f, line):
3
by: MackS | last post by:
Hi I'm new to Python and would like to know if the following is possible. Say I have one lower-level object A and one user-interface object B. Suppose B.CallingMethod() calls A.CalledMethod(),...
3
by: mirandacascade | last post by:
Verion of Python: 2.4 O/S: Windows XP ElementTree resides in the c:\python24\lib\site-packages\elementtree\ folder When a string that does not contain well-formed XML is passed as an argument...
5
by: juergen perlinger | last post by:
Hello out there. sometimes I need to have proper control of the floating point arithmetic of the C(and C++) runtime system, and using the f.p. exception handling of the C99 standard is quite...
40
by: Dave Hansen | last post by:
Please note crosspost. Often when writing code requiring function pointers, it is necessary to write functions that ignore their formal parameters. For example, a state machine function might...
3
by: elziko | last post by:
I have a procedure that creates a bitmap of a certain size and then displays it in a 3rd party component. However, if the bitmap is very large then a System.OutOfMemoryException is thrown my...
1
by: Bob | last post by:
In Vs 2005 you have new applicationsEvents.vb I was testing it in a simple app and found that it was easier to implement unhandled exception management tah it was in Vs2003 (vb.net) You can, if you...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
5
by: =?Utf-8?B?c3VydHVyeg==?= | last post by:
Hi, I feel like a noob for asking this. When I publish a VB windows application, I want to disable the ability of the the user to continue when there is an unhandled exception. For example,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.