473,545 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unhandled exceptions checking

Does somebody know existent tool for checking unhandled exceptions?
Like in Java when method throws exception but in code using this
method, try...catch is missed. May be something like PyChecker?

--
/Pavel
Jun 27 '08 #1
5 1414
On May 23, 6:31*pm, Yosifov Pavel <aqua...@gmail. comwrote:
Does somebody know existent tool for checking unhandled exceptions?
Like in Java when method throws exception but in code using this
method, try...catch is missed. May be something like PyChecker?

--
/Pavel
I know that pychecker doesn't do that. The set of handled exceptions
is probably much smaller than handled. Almost every line of code can
throw ten different exceptions (at least my code). I'm not sure what
specifically the output you'd like to see would look like.
Jun 27 '08 #2
On Sat, May 24, 2008 at 3:31 AM, Yosifov Pavel <aq*****@gmail. comwrote:
Does somebody know existent tool for checking unhandled exceptions?
Like in Java when method throws exception but in code using this
method, try...catch is missed. May be something like PyChecker?
Python is too dynamic to do this reliably. eg:

e = exception_retur ning_func()
raise e

You'll probably be better served by capturing and logging all
unhandled exceptions in your app ("logger.except ion(e)" works nicely
in a high level "catch Exception e" block), and then notifying users.

Another thing to try is coverage testing. Won't raise all possible
exceptions in a given piece of code, but at least you can check if
all lines get run once.

David.
Jun 27 '08 #3
Yosifov Pavel wrote:
Does somebody know existent tool for checking unhandled exceptions?
Like in Java when method throws exception but in code using this
method, try...catch is missed. May be something like PyChecker?
I've seen this a number of places. Apparently there are a number
of programmers who find exceptions to be a problem to suppressed,
rather than an indicator of a deeper bug. Your goal should be to
handle anticipatable problems where you can, and reveal the others,
not to make sure you cannot raise an exception. Exceptions are
valuable in that they reveal "thinko"s, embrace what they tell you,
and don't look for mechanical ways to avoid them; test them out.

--Scott David Daniels
Sc***********@A cm.Org
Jun 27 '08 #4
On 24 ÍÁÊ, 12:58, bukzor <workithar...@g mail.comwrote:
On May 23, 6:31 pm, Yosifov Pavel <aqua...@gmail. comwrote:
Does somebody know existent tool for checking unhandled exceptions?
Like in Java when method throws exception but in code using this
method, try...catch is missed. May be something like PyChecker?
--
/Pavel

I know that pychecker doesn't do that. The set of handled exceptions
is probably much smaller than handled. Almost every line of code can
throw ten different exceptions (at least my code). I'm not sure what
specifically the output you'd like to see would look like.
OK. I understand point of view of all responders.
It seems I surmised why it's very difficult to do in tool like
PyChecker:
not only functions/methods but usual Python expression can mask
potential
exception source. And this tool must know how to parse every
expression
deep (to object protocol methods, for example). But it's possible in
principle...
And you are right: the output of this tool will be very verbal :-)

Thanks to all
Jun 27 '08 #5
On Sun, 25 May 2008 21:00:01 -0700, Yosifov Pavel wrote:
OK. I understand point of view of all responders.
It seems I surmised why it's very difficult to do in tool like
PyChecker: not only functions/methods but usual Python expression can
mask potential exception source. And this tool must know how to parse
every expression deep (to object protocol methods, for example). But
it's possible in principle...
So which *specific* exceptions can be thrown by this function:

def f():
raise globals()[raw_input()]()

Ciao,
Marc 'BlackJack' Rintsch
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2264
by: terry | last post by:
Hi, Question: When using Framesets and Server.Transfer in the Application_Error event handler is there a mechanism to get the error page to display in the total view of the browser not just in the offending frame? Overview: I have an application in which I am using framesets. When an Unhandled exception occurs I try to handle it
4
2396
by: Frank | last post by:
Hi, I made a handler for unhandled errors. But before that is executed, VB.NET gives me the standard error window. In VB6 there was a setting (errortrapping) about handling errors in the design environment and classes, which should prevent the before mentioned behaviour. Does VB.NET have a setting like it? Or is there something else? ...
5
5726
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by thread.Abort()) is reported twice: once in the debug window, and once through the message box. Is it because the thread was sleeping when the...
5
3287
by: Samuel R. Neff | last post by:
When you have an unhandled exception in vb.net how do you view the exception information in the debugger? In C# the debugger creates a local variable that points to the exception and you can view it in one of the windows (autos or locals, don't remember which). That doesn't appear to be the case with vb.net. I also tried using the...
5
4526
by: Sam Loveridge | last post by:
Hi All. I'm hoping someone can point me in the direction of a solution to unhandled exceptions in MDI child forms causing the application to crash. I've found various articles describing a method using Application.Run(new MyMainParentForm) to place in the application's Sub Main to allow catching of unhandled exceptions in the application....
0
1973
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks about in a new application I'm writing. However, when I try to use ThreadStart to do some work in a separate thread from my GUI, the methods Jason...
2
2175
by: Bob | last post by:
I MUST be able to trap unhandled exceptions, bring the thread to a routine that then closes the thread on which the execption occurred without closing or affecting the other threads. Think of an Interactive voice response telephone application. An unforeseen error occurs on one phone call. You terminate that phone call politely but you don't...
3
1938
by: Andreas van de Sand | last post by:
Hi everyone, I've got an application which uses a custom exception handler and to avoid unhandled exceptions I've got a try{}catch (Exception){} block around the main Application.Run(...). Works all good on my machine, whenever something unexpected happens the exception get caught, logged and it shows a nicer message. Unfortunately for...
20
11437
by: joseph_gallagher | last post by:
Hi, I've recently ported a .Net 1.1 application to .Net 2.0 and the one new feature that is getting on my nerves is that when there is an unhandled exception the application completely crashes, causing user to loose all the work they have done where they could previously just click continue and in 99% of cases be fine. Is there an option to...
0
7415
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
726
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.