exception

Java: load an object saved on hard disk after refactoring => "class not found" exception :/

Hello, I'm developping an application in java that regulary saves objects onto the hard disk using this simple method: public void save(String filename) { try { FileOutputStream fos = new FileOutputStream(filename); GZIPOutputStream gzos = new GZIPOutputStream(fos); ObjectOutputStream out = new ObjectOut...

Go - Raise an exception

I would want to raise an exception as it's made in Python or Java --to finish the program with an error message--. An error message could be returned to a parent function: func readFile(filename string) (content string, err os.Error) { content, err := ioutil.ReadFile(filename) if err != nil { return "", os.ErrorString("...

Can't resolve CalledFromWrongThreadException with Handler

I will try to keep it simple: In my main activity I make a handler: public class ARViewer extends ARDisplayActivity { public final MHandler mHandler = new MHandler(this); public void onCreate(Bundle savedInstanceState) { ... The class MHandler: public final class MHandler extends Handler{ //main activity private ARV...

Why ClassCastException on JMS ConnectionFactory lookup in JNDI?

What might be the cause of the following ClassCastException in a standalone JMS client application when it attempts to retrieve a connection factory from the JNDI provider? Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference cannot be cast to javax.jms.ConnectionFactory Here is an abbreviated version of the...

Receiving "Path 'OPTIONS' is forbidden." Exception in ASP.NET website

I am getting the error System.Web.HttpException: Path 'OPTIONS' is forbidden. since we moved our website over to a new server setup. I am unable to recreate the error but I am receiving emails for this exception at least a few times a day. Any ideas what could be causing this and how I can fix it? EDIT: Stack Trace: at System.Web.HttpM...

Globally Log Catch Exception e

Suppose that I have a legacy java application with thousands of lines of code which do: try { // stuff } catch (Exception e) { // eat the exception } Is there any global option that I could flip or 3rd party JAR which would log all "eaten" exceptions? I know that I could do a massive find replace (search for catch (Exception e)...

How to profile and capture double deletion of and memory corruption in c++

Hi I have application that I compiled with VS 2008 on windows 7 with c++ And I got exception I trying to catch this I created pdb file (because I compiled in release) . and see part of the stack ,but it doesn't give me hints on where the error. Im looking for free ways to get this error .can you recommend on free ways to do this? ...

How do I add information to an exception message without changing its class in ruby?

How do I add information to an exception message without changing its class in ruby? The approach I'm currently using is strings.each_with_index do |string, i| begin do_risky_operation(string) rescue raise $!.class, "Problem with string number #{i}: #{$!}" end end Is there a better way? ...

Error: Current Displayable is an Alert

I get the following error: Illegal Argument java/lang/IllegalArgumentException Current Displayable is an Alert I'm not sure what is means and why this exception is fired. ...

AJAX Panel not throwing exceptions

Hi, i have just noticed something strange in some asp.net markup. I have a standard form with a couple of textboxes and a submit button. When clicked the code behind will attempt to perform some logic and then return. If the input values are not valid it used to throw an exception. The moment i wrapped the controls in an AJAX update ...

Active Directory login - DirectoryEntry inconsistent exception

I need to validate the LDAP user by checking if there exists such a user name in the specified domain. For this I am using this code - DirectoryEntry entry = new DirectoryEntry("LDAP://" + strDomainController); DirectorySearcher searcher = new DirectorySearcher(entry); searcher.Filter = "SAMAccountName=" + strUserName; SearchResult res...

What are the standard practices for throwing JavasScript Exceptions?

w3schools says that exceptions can be strings, integers, booleans, or objects, but the example given doesn't strike me as good practice, since exception type checking is done through string comparison. Is this the preferred method of exception handling in JavaScript? Are there built-in exception types (like NullPointerException)? (if so,...

How to catch an exception thrown in another Powershell script ?

Good morning, I have a two Powershell scripts; main.ps1 and sub.ps1. main.ps1 calls sub.ps1. Sometimes sub.ps1 throws an exception. Is it possible to catch the exception thrown by sub.ps1 from main.ps1 ? Example main.ps1: try{. .\sub.ps1;} catch {} finally {} Example sub.ps1: throw new-object System.ApplicationException "I am an ex...

Reflection PropertyInfo GetValue call errors out for Collection<> type property.

Hey Guys, I have a propertyInfo object and I try to do a GetValue using it. object source = mysourceObject //This object has a property "Prop1" of type Collection<>. var propInfo = source.GetType().GetProperty("Prop1"); var propValue = prop.GetValue(this, null); // do whatever with propValue // ... I get error at the GetValue() ca...

How do I catch global exceptions?

Is there a way to catch global "crashing" app exceptions like objc_exception_throw, EXC_ARITHMETIC etc. in code? I need that because I want to do some things before the app gets killed by the system. ...

Unknown Exception on trying to initialize the web service stub created by Axis C++

Hi, I am trying out the sample calculator program given in the folder of axis c++. I am mainly interested in the client side. So I used the wsdl to create the stubs and my main is pretty much the same as given in the sample. However on executing the call Calculator ws (endpoint) I get an unknown exception "First-chance exception at 0...

Enteprise Library Exception Handling for WCF Fault Contracts - CLIENT SIDE

I have a Windows Service which communicates with WCF services. The WCF services are all fault shielded and generate custom UserFaultContracts and ServiceFaultContracts. No problems there. In the Windows Service I am using EntLib for exception handling and logging. I do not want to try catch for faults try { } catch (FaultException<Us...

When would you prefer to declare an exception rather than handling it in Java?

I know we can declare the exception for our method if we want it to be handled by the calling method. This will even allow us to do stuff like write to the OutputStream without wrapping the code in try/catch block if the enclosing method throws IOException. My question is: Can anyone provide an instance where this is usually don...

Catch a thread's exception in the caller thread in Python

Hi Everyone, I'm very new to Python and multithreaded programming in general. Basically, I have a script that will copy files to another location. I would like this to be placed in another thread so I can output .... to indicate that the script is still running. The problem that I am having is that if the files cannot be copied it wi...

phpUnit - mock php extended exception object

I'm testing some legacy code that extends the default php exception object. This code prints out a custom HTML error message. I would like to mock this exception object in such a way that when the tested code generates an exception it will just echo the basic message instead of giving me the whole HTML message. I cannot figure out a w...