exception

resharper - question on exception warning

Consider this method (pardon the sad attempt at Chuck Norris humor :) ): public class ChuckNorrisException : Exception { public ChuckNorrisException() { } public ChuckNorrisException(string message) : base(message) { } public ChuckNorrisException(string message, Exception cause) : base(messa...

PHP: Merge catches

Could I merge two catches in PHP? try { // some code } catch (App_Exception $e) { // do sth. } catch (Exception $e) { // do the same exception code again } ...

Is it possible to extract some structured information from the Exception.StackTrace?

I was wondering if it's possible to convert the string StackTrace in the exception to a more structured data object? Or is there a method that can get me this information while I am catching the exception? Maybe something using reflection? Thanks! ...

Java Exceptions, What to catch and what not to?

I keep getting the dreaded java.something.someException errors while running my java app. and I don't seem to be getting the hang of what exceptions to handle and what not to? When I read the api docs most of the functions throw exceptions like if I use I/O or use an Array... etc. How to make a decision about what exceptions to catch an...

Exception Handling

Is there a way in C# to catch any kind of exception? Like in C++ to catch any kind of exception the format is like try{ //Statements } catch(...){ // Some more statements } But this format in c# fails. Help? ...

What is the NS_ERROR_INVALID_POINTER error in Firefox?

While testing JavaScript code in Firefox 3.5 I sometimes get the following error: Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) I've tried Googling it, but all I can find are solutions to specific problems in other people's code (ie. "if you do this differently then the error will not occur"). But what I'd lik...

Exception in JSP usebean.

I've been working with JSP usebean, when I am trying to use bean in JSP, its throwing an exception that "It cannot find the class". But I've followed the correct structure, I assume, and included everything required. Please go through the code and let me know what could be the problem. //init.jsp -------- <%@ page import="com.wipro.uplo...

ASP.NET Exception Handling

I'm working on a traditional ASP.NET application where I'm making a WCF call to perform some operations. The question is, should I put a try catch around the WCF call and display the error details at the top of the current page, or let the error redirect the user to a custom error page, or the dreaded yellow screen of death? ...

Showing an alert in an iPhone top-level exception handler

I'm trying to display a UIAlertView in a top-level iPhone exception handler. The handler function looks like this: void applicationExceptionHandler(NSException *ex) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:[ex reason] ...

How to debug a program that is terminating in an unhandled exception???

Hi all, I am programming in C++ on Linux platform. My program terminates with this (unhandled???) exception: "terminate called after throwing an instance of 'long'" Aborted The code that is throwing the exception is inside try-catch block, then why should this happen?? The exception is thrown while returning from a function. I am us...

Can I use throws in constructor?

I have to initialize file objects inside the constructor and for handling the exception, is it efficient using throws or should I go for try/catch? ...

Ways to prevent broken pipe?

ClientAbortException: java.net.SocketException: Broken pipe If I am wright, this happens when user aborts current operation or makes another request, before the last one is finished. Can this reflects on browsing user or is this (always) just a Catalinas exception? Are there any ways to avoid this exception? ...

How to get rid of exceptions thrown by the .NET Framework

In a recent project I'm using a lot of databinding and xml-serialization. I'm using C#/VS2008 and have downloaded symbol information for the .NET framework to help me when debugging. The app I'm working on has a global "catch all" exception handler to present a more presentable messages to users if there happens to be any uncaught exce...

Where do you define spring bean configuration files

I am separating my spring bean configuration files as follows: myapp-service.xml myapp-servlet.xml However I am getting the error; Error creating bean with name 'beanName' defined in ServletContext resource [/WEB-INF/myapp-servlet.xml]: Cannot resolve reference to bean 'beanService' while setting bean property 'beanService'; nested...

Get stack trace from uncaught exception?

I realise this will be platform specific: is there any way to get a stack trace from an uncaught C++ exception, but from the point at which the exception is thrown? I have a Windows Structured Exception Handler to catch access violations, etc. and generate a minidump. But of course that won't get called in the event of termination due t...

Compile issues based on different platforms

I'm compiling a solution which runs fine on the PC but when trying to compile it for a different platform I get the following error: "Unhandled Exception: System.ArgumentException: An item with the same key has already been added." Anyone know what it could mean? ...

Throw FileLoadException or just IOException

I am writing an app and I want to load a file based on a path provided by the user. I check the extension of the file and when the extension does not match anything I recognize I want to throw an exception. I could throw an IOException. But, I figured there could be a more detailed exception derived from that. So I looked at MSDN and f...

ASP.NET: A potentially dangerous Request.Form value was detected from the client

I have a client that claims to get the server error "A potentially dangerous Request.Form value was detected from the client" ...and this is likely to be that html is entered and something I need to fix a better way of managing than validateRequest=true. http://www.aspcode.net/A-potentially-dangerous-RequestForm-value-was-detected-fro...

How to log exceptional situations in C++?

When writing a function, my implementation very frequently looks like this: Call a subfunction If this subfunction fails to execute (because of an exceptional situation): log this failure and abort the current function Otherwise continue calling other subfunctions, which in turn can fail A crucial part is the logging. Every function ...

Thin (ruby) is barfing

Simple sinatra app: require 'rubygems' require 'sinatra' get '/' do "Hey" end Then: $ ruby test.rb And when I hit http://localhost:4567, it drops the connection and I get: /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin_parser.bundle: dlopen(/usr/local/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin_parser.bundle, 9): no suita...