473,472 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to bypass ExceptWarn.py exceptions/errors

jesuscider
5 New Member
I used ExceptWarn.py to catch exceptions/errors in my sds/2 custom member, now the system makes the user hit OK every time the error message pop out... Is there any way I could put those messages in a warning message list allowing processing to finish without having to hit OK?
May 6 '11 #1
2 2092
bvdet
2,851 Recognized Expert Moderator Specialist
I am sure there is a way do do what you describe. Here is a common usage (snippet from BentBolt_v3.04.py):
Expand|Select|Wrap|Line Numbers
  1. from macrolib.ExceptWarn import formatExceptionInfo
  2.  
  3.  
  4.         ## Set self.boltType
  5.         dlg1 = setTypeDialog(self)
  6.         try:
  7.             dlg1.get().done()
  8.         except ResponseNotOK:
  9.             self.cleanUP()
  10.             return
  11.         except Exception, e:
  12.             Warning(formatExceptionInfo())
  13.             self.cleanUP()
  14.             return
Upon an error, the error information is displayed in a warning widget, cleanup is performed, and the script terminates. You could do something like this instead:
Expand|Select|Wrap|Line Numbers
  1. from macrolib.ExceptWarn import formatExceptionInfo
  2.  
  3. errorList = []
  4.  
  5. try:
  6.     # some code to execute
  7. except Exception:
  8.     errorList.append(formatExceptionInfo())
  9.  
  10. print "\n".join(errorList)
Most of the time you would not want the code to proceed when an error occurs. If an inconsequential error does occur, a simple pass may be more appropriate.
Expand|Select|Wrap|Line Numbers
  1. try:
  2.     # some code to execute
  3. except:
  4.     pass
May 6 '11 #2
jesuscider
5 New Member
Thank you very much bvdet that was a great help..
May 9 '11 #3

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

Similar topics

26
by: Zunbeltz Izaola | last post by:
Hi, I've the following problem with try/exception. I've a try block that will raise some exceptions. I want the program to ignore this exceptions completely. Is it possible? Thanks in...
24
by: mag31 | last post by:
Is there any way to find out if a particular .net function will throw an exception without first generating the exception? I am using structured exception handling i.e. try catch finally blocks...
5
by: Mark Oueis | last post by:
I've been struggling with this question for a while. What is better design? To design functions to return error codes when an error occures, or to have them throw exceptions. If you chose the...
13
by: kelvSYC | last post by:
What I want to do is to read a 32-bit unsigned integer (let's call that u32) in little-endian form from an fstream. Would it be better if my function went like this: // returns false if an...
2
by: headware | last post by:
I realize that when making a web application, performing input validation in the browser is good because it prevents postbacks. However, input checking that goes beyond making sure a value exists...
3
by: Mike Wilson | last post by:
How do I turn on the VB6 "Break on All Errors" equivilent in VB.NET 2005? I want to bypass my error handling for the time being while I developer-test some parts of my application. Many...
40
by: Mark P | last post by:
I'm implementing an algorithm and the computational flow is a somewhat deep. That is, fcn A makes many calls to fcn B which makes many calls to fcn C, and so on. The return value of the outermost...
3
by: clintonb | last post by:
Some programmers, and even Microsoft documents, say you should only throw exceptions for exceptional situations. So how are others handling all the other unexceptional errors? How are you...
5
by: adam.timberlake | last post by:
I've just finished reading the article below which goes into some depth about exceptions. The article was rather lucid and so I understand how to implement it all, the thing I'm having trouble with...
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
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,...
0
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...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.