I've got a list comprehensions which filter a list:
l = [obj for obj in objlist if not obj.mycond()]
but the object method mycond() can raise an Exception I must intercept. I need to collect all the errors at the end of the loop to show which object has created any problems and at the same time I want to be sure to loop all the list e...
I have written a program which uses a SQL exception class and then use it show custom messages for the primary key violation. Also i want the primary key value that caused the violation. How can i get all the primary keys which generated the exception from the sqlexception object.
Catch se As SqlException
For i As Integer...
In Tools | Options | Debugger Options | Language Exceptions it's possible to ignore specific Exception types. Is it possible to do define this per project?
Eg in the Debug Build Configuration (Delphi 2009 and/or 2010)?
/Edit: Reported in QC
...
How do I get a C++ application including a loaded ada shared library to generate a core dump?
I have a C++ application which loads a ada shared library, inside the ada code I get a stack overflow error which causes program termination along with the console output:
raised STORAGE ERROR
No core dump file is generated even thou I have ...
Hello all,
One on my team is having a problem with a project he got from our SVN. When he tries to run a file he gets the error:
java.lang.NoClassDefFoundError: misc\test (wrong name: misc/test)
We really don't understand why he gets this error. Seems like the slashes are the cause of it, but I don't understand how this is a problem ...
In python is it possible to have the above code without raising an exception ?
def myfunc():
pass
# TypeError myfunc() takes no arguments (1 given)
myfunc('param')
Usually in php in some circumstances I launch a function without parameters and then retrieve the parameters inside the function.
In practice I don't want to declare ...
I have a friend that is moving a web application from one server over to another. The new server has the same settings as the first server, however, he's running into a Security issue. Here's the error details:
Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToke...
Hello,
I'm not matching any key to value in my code, my code is only about implementing protocol in interface implementation.but when i try to execute, i'm not getting any error, but its crashing due to this exception:
***Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MyClass 0X3d1d2b0>setvalue:forundefin...
Hi All
I am trying to get a little client/server thing going just to learn how to do it... But after using many samples, following several tutorials even on msdn, none of them have ever worked.
I keep getting the following exception:
System.Net.Sockets.SocketException: No connection could be made because the target machine actively re...
Are there any good exception notification systems for web apps using Tomcat? Looking for libraries equivalent of exception_notification etc. which are available as plugins for Rails.
...
The issue came up in this question, which I'll recapitulate in this code:
import csv
FH = open('data.csv','wb')
line1 = [97,44,98,44,99,10]
line2 = [100,44,101,44,102,10]
for n in line1 + line2:
FH.write(chr(n))
FH.write(chr(0))
FH.close()
import _csv
FH = open('data.csv')
reader = csv.reader(FH)
for line in reader:
if '\0' in...
Hello all,
I'm writing a custom error-handling method, and am passing it an Exception object. I need to be able to access that Exception's ExceptionContext object, so I can set a property to true before I execute the Error view. Does anyone know how to get to the ExceptionContext, given just an Exception object?
For reference, the reas...
In my code below, I am using Process objects to execute a series of DOS batch files.
I'm shortening the list of scripts for example's sake.
The subsequent (1+) scripts execute via an event handler (instead of a for loop). That way, each subsequent script runs ONLY when the previous one finishes. Now for some reason as I execute the 2nd ...
I am new to Python and trying a multiprocessing.pool program to process files, it works fine as long as there are no exceptions. If any of the thread/process gets an exception the whole program waits for the thread
snippet of the code:
cp = ConfigParser.ConfigParser()
cp.read(gdbini)
for table in cp.sections():
jobs.append(table)
...
I'm trying to use Java's ThreadPoolExecutor class to run a large number of heavy weight tasks with a fixed number of threads. Each of the tasks has many places during which it may fail due to exceptions.
I've subclassed ThreadPoolExecutor and I've overridden the "afterExecute" method which is supposed to provide any uncaught exceptions ...
I'm trying to test that I'm throwing an exception when appropriate. In my test class I have a method similar to the following:
public void testParseException() {
try {
ClientEntitySingleton.getInstance();
fail("should have thrown exception.");
} catch (RuntimeException re) {
assertEquals(
"<...
WARN NHibernate.Util.ADOExceptionReporter - System.Data.SqlClient.SqlException: Invalid object name 'X'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Ru...
Not sure exactly what's wrong here:
while(itr.hasNext())
{
Stock temp =itr.next();
}
This code is throwing a ConcurrentModificationException at itr.next();
Initialization for the iterator is
private Iterator<Stock> itr=stockList.iterator();
Any ideas?
[The basic code was copied directly from professor's slid...
This code will throw Concurrent Modification Exception if the list is modified in doSomething(). Is it possible to avoid it by enclosing the code in some synchronized block?
List l = Collections.synchronizedList(new ArrayList());
// normal iteration -- can throw ConcurrentModificationException
// may require external synchronization
fo...
public static void parseit(String thexml){
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser;
try {
saxParser = factory.newSAXParser();
DefaultHandler handler = new DefaultHandler() {
public void startElement(String uri, String localName, St...