exception

Affectations and exceptions

Lets consider I have the following function: SomeType createSomeType(); which can throw depending on some reasons. Then: SomeType val = SomeType(); // initial value try { val = createSomeType(); // here } catch (std::exception&) { } If createSomeType() throws, can I always assume that val value is unchanged ? ...

.NET iterator to wrap throwing API

Hi. I have a class with an API that allows me to ask for objects until it throws an IndexOutOfBoundsException. I want to wrap it into an iterator, to be able to write cleaner code. However, I need to catch the exception to stop iterating: static IEnumerable<object> Iterator( ExAPI api ) { try { for( int i = 0; true; ++i ) ...

"An unexpected network error occurred." happens occasionally, unable to isolate

I have a VB .NET Application which I have written for my company which occasionally throws a message “System.IO.IOException: An unexpected network error occurred.”, that I have been unable to figure out the issue. The application is a Backup program which to simplify for this post does the following: 1) Checks for H drive or external d...

Java ArrayIndexOutOfBounds Exception

Hi, Perhaps I have been looking at this for too long as I cannot find the problem, yet it should be something simple. I am receiving an ArrayIndexOutOfBounds exception on the line: nextWord = MyArray[i + 1].toLowerCase(); Can anyone see why? String currentWord = ""; String nextWord = ""; for (int i = 0; i <= MyArray.length; ...

Vb.net Exception

I have just converted my c# code to vb.net. And it is giving exception. c# code : private static short[] muLawToPcmMap; decoded[2 * i + 1] = (byte)(muLawToPcmMap[data[i]] >> 8); vb code : decoded(2 * i + 1) = CByte(muLawToPcmMap(data(i)) >> 8) Exception : Arithmetic operation resulted in an overflow. I am in very much trouble....

log4j exception handling problem

I have a class which initializes my log4j. This code will never print or exit, I dont understand why. public class MyLog { private static Logger log; static { log = Logger.getRootLogger(); try { PropertyConfigurator.configure("somefileNameWhichDoesNotExist"); } catch(Exception t) ...

How to see list of possible exception in some Class.(C#.NET)

Hello. I have a lot of classes that have been written in C#.NET, and I need to know what exceptions can be thrown by them. How I can do it in Visual Studio 2005. ...

what is the best way to show errors on asp.net mvc ajax requests

if i call a ajax request using jquery to an asp.net mvc controller action and inside that action an exception gets thrown, what is the best way to capture that and show something to the user. right now my loading image just goes on forever . . . . here is an example of my controller code: public ActionResult BatchAdd(int[] sharepoin...

Deciphering the .NET clr20r3 exception parameters P1..P10

i'm trying to decipher the meaning on the P1...P10 parameters associated with a clr20r3 that is written to the event log when my application experiences an exception. The best i've been able to find is: P1: the hosting process (e.g. w3wp.exe) P2: the hosting process version (e.g. 6.0.3790.1830) P3: ??? (e.g. 42435be1) P4: the assembly...

Using JSP with Embedded Jetty 7 in Eclipse IDE, getting LogConfigurationException

I've included all jars the application requires, I'm trying to use Jetty Embedded I have a simple java class with a main method that has the following setup, servlets still work correctly just can't get JSP's to work. All required jars are included, started with basic Jetty jars then added all from the jsp folder. Server server = new ...

ASP.NET Custom errors for developer machines

Does this ever happen to you? You are sitting at your development machine and you are made aware of an unhandled exception in a deployed asp.net application. You visit the deployed web app. You can't see the exception detail in your browser, because custom errors is set to remote only. So you have to login to the web server and instigat...

WEB Logic throughs java.lang.ClassNotFoundException: FeatureForm when I compile and deploy a change in my eclipse maven project

Hello all, I just started using Maven with eclipse and deploy my application to web logic. When I do a clean install for the first time, my maven project builds and deploy successfully. after that, when I make any change to the source code or jsps.. I do a pre-clean install to update the project. Now, everytime I do pre-clean install a...

Common exceptions while executing sql queries

I have read that catching the particular exception separately enhanced the performance so I just wanted to know what are the most common exception that might generate while executing any sql query ...

Java null pointer exceptions - don't understand why...

Run time error on main method in MovieList.java. I'm not sure my program design is fundamentally very good, but I'd like to know why it crashes. Thanks in advance. package javaPractical.week3; import javax.swing.*; public class Movie { //private attributes private String title; private String movieURL; private String ...

If I get a complete and valid HttpWebResponse but the contents are invalid, what type of exception should be thrown?

What I'm doing is grabbing JSON off a website to deserialise it with a DataContract class. So what if the response I get doesn't match the class? I would be getting a SerializationException, but I'm thinking it would be better as an InnerException to a different exception, as the response is therefore incomplete or not JSON at all. Righ...

C#: Article about throwing proper type of exception

Sometimes I dont know witch type of exception should I throw. So I usually throw Exception(). Is there some nice article about this? ...

Toast does not display when used in catch block

I noticed that a toast isn't displayed when it's used inside a catch block. Does anyone know how to show toasts when catching exceptions? An Example: try { // try to open a file } catch (FileNotFoundException e) { Toast.makeText(this, R.string.txt_file_not_found, Toast.LENGTH_LONG); return; // cancel processing } ...

itk filereader causes access violation exception

I have a problem with an Access Violation Exception. I am using itk and read a File with it's file reader. ThreeDImageFloatType* MyClass::loadImage(std::string filename){ const char* cfilename = filename.c_str(); fileReader = ImageFileReaderType::New(); fileReader->SetFileName(cfilename); try{ fileReader->Update(); }catch( ... ) ...