exception

How do I log an exception when I don't know where it might throw?

We have a WPF application that we've deployed to the customer. However, the application is randomly fatally crashing with an "unexpected error" dialog box on the customer's computer. We need to be able to see the exception message and preferably stack trace as well, but because it's crashing randomly, we don't know where we should be put...

C++ re-throw an exception caught by ...

Hi, how can I re-throw an exception caught by catch(...) block? ...

C++ get description of an exception caught in catch(...) block

Hi, can I get description of an exception caught by catch(...) block? something like .what() of std::exception. ...

Application global Error Logger

Hi all, While working on a vb.net application, in which exceptions were handled poorly. It was a big pain. So an Idea flashed , that if it is possible to genearte a library or service or some sort of exe that will log all error of an application without writing a single line of code / minimal code at some global location in host applic...

Is there any way to provide constructor parameters to generic instances?

I can't do this in C#: catch (Exception exception) { var wrappedException = new TException(exception); } Getting error "cannot provide arguments when creating an instance of type parameter 'TException'. Just wanted to check with the community to see if there is any way to do something like this? ...

How to handle exceptions on Doctrine 2 validation

I'm new to Doctrine 2 (and exceptions in PHP, really), but am trying to come up with a robust validation engine on Doctrine 2 (on top of CodeIgniter), following this page. Right now I'm wondering where I would define the ValidateException class, and how to 'try' doing a save (persist?) on my entity (from a controller, library, etc). I'...

How to treat exceptions in constructor best?

Hi, How to treat exception in best way in construct? option1 - catch exception where object created: class Account { function __construct($id){ if(empty($id)){ throw new My_Exception('id can\'t be empty'); } // ... } } class a1 { function just($id){ try { $account = new Acc...

JPQL MySQLSyntaxErrorException: You have an error in your SQL syntax

Hello, I have two entities User and Group: @Entity public class User implements Serializable { private static final long serialVersionUID = 1L; @Id private String username; private String password; private String email; @ManyToMany @JoinTable(name="user_group", joinColumns={@JoinColumn(name="USERNAME")}, inv...

Locating the source of managed exceptions that aren't coming directly from my code?

I apologize in advance if this is really a Super User question... I just wasn't sure, but this seems more on the dev. side than on the tech support side. :) This isn't necessarily a problem, but it does actually drive me totally bonkers on my system. It also only happens on my computer. When I launch any application, even a blank WPF...

Show form when exception occurs C#

Hi, I have been looking at the Windows API Code Pack 1.1 and have seen a Error sample and would like to integrate it into my Application, the main idea would be for it to show if any error in the application happens, well not any but some that I choose. How can I program this? I am using WPF Thanks ...

How does Haskell exception handling work?

foldl1 (+) [] How do I catch the resulting error? ...

JavaMail stops sending mails after a while

Hello, I am currently doing a summer job as Java programmer. We have an application where people can enter their tasks, agenda, etc. The program is a client-server program, so all data is stored on a server. My boss asked me to make a mail notification system. For example, when a deadline of a task is near, it sends an email to the per...

Why stacktrace is not displayed when an exception occurs?

Hi all. I have a problem. My program crashes on start up without any stack trace. The only thing I can see is "Send Report To Microsoft". This happens only on one PC. Can you explain me Why some exceptions are with stack trace and some are without? Thanks. ...

How to print exception stack trace of Objective-C exceptions with GNU runtime and without GNUStep?

I have an Objective-C app build on Linux with GCC 4.3 using no specific framework (only GNU-runtime). I am using Objective-C exceptions (via the '-fobjc-exceptions' compiler flag). Now I want to print the stack trace of such an exception when I caught some. Or what would make me even happier: put the trace in a string or some kind of st...

PHP: How can we disable exception messages on production website and keep them in dev?

Hi, How can be disable exception messages on the production website and keep them in dev? Example: try{ //some code } catch(Exception $e){ echo $e.getMessage(); } Edit: How it done on Zend Framework? (.ini file but what about exception code that should be write?) Edit 2: If my example can't work how zend framework disabl...

ASP.NET application throwing "unable to find assembly" error for NHibernate

So let me start by saying that the weird thing about this error is that the application is running, and the error bubbles to the event log, but it's intermittent. Sometimes it's 2 hours between it happening, sometimes a few minutes, sometimes half an hour. Does not appear to be tied directly to requests (and requests don't seem to be f...

ASP.NET - When to use custom exceptions?

Hey there, I keep hearing over and over again that I should ALWAYS use custom exceptions in my web apps.. The problem is that I dont see any reason for making custom exceptions when they all are handled in the global.asax(write to database etc.) anyway.. So why should I use them? ...

Android Error handling - Sorry - The application has stopped unexpectedly

I've got it wrapped in a try catch, but the exception still trips that ugly screen. URL u = null; try { u = new URL(txturl.getText().toString()); } catch (MalformedURLException e) { ReportError(e,"Unable to connect to "+u); } calls this: private void ReportError(Exception e, String message){ Displ...

JavaScript list of exceptions

Hi all, This time I don't have any problem but just for curiosity I want to know how many exception are there in JavaScript. For example I am using following code: <script type="text/javascript"> var x; try{ x = 1 / 0; alert(x); // output: Infinity. FYI: JavaScript has Infinity property and it's value is 1.7976...

getting beyond bounds error

hii i am working on a sqlite based application in which there is a field at index 2 in the sqlite database in which i am not saving any data but when i run that database on firefox i saw that the index 2 had a value -2147483648, and when i am trying to add a new cell in my subview by: return [appDelegate.items count]+1; i am getting t...