exception

ASP.NET Access to the temp directory is denied.

I'm experiencing this problem today on many different servers. System.UnauthorizedAccessException: Access to the temp directory is denied. The servers were not touched recently. The only thing that comes in my mind is a windows update breaking something.. Any idea? This happens when trying to access a webservice from an asp.net page...

How to rescue an eval in Ruby?

I'm trying to figure out how to rescue syntax errors that come up when eval()ing code in Ruby 1.8.6. I would expect the following Ruby code: #!/usr/bin/ruby good_str = "(1+1)" bad_str = "(1+1" # syntax error: missing closing paren begin puts eval(good_str) puts eval(bad_str) rescue => exc puts "RESCUED!" end to produ...

How to catch exceptions in javascript?

I want to catch exceptions in javascript if an insertion query is not done. I have written the code below: var adoConn = new ActiveXObject("ADODB.Connection"); var adoRS = new ActiveXObject("ADODB.Recordset"); var rec = new ActiveXObject("ADODB.Record"); adoConn.Open="DRIVER={MySQL ODBC 3.51 Driver};SERVER=172.25.37.145;" + "DATABASE=c...

Getting receive pipeline error information in BAM

Hi! I have two orchestrations One of them is used as an error handler for the other orchestration, and is getting failed messages from it. I have set this up in bam. The problem is when a file fails in the receive port I don't get any usefull information in the Activity Search. Only that something has been registered. Data ex from Bam: ...

What can cause Outlook to change a COM-addin's LoadBehavior to 2 - other than unhandled exceptions?

For some weeks now we have been fighting with an issue where at a small number of customers our Outlook addin gets unloaded and disabled for yet undetermined reasons. By "disabled" I mean that Outlook changes the following registry value from 3 to 2 which in effect means that the addin will not be loaded on next startup: HKEY_LOCAL_MACH...

What's the essential difference between the two HandleException() methods of Exception Handling Application Block (Ent Lib 4.1)

In the most recent version (4.1, released October 2008) of The Microsoft Enterprise Library's Exception Handling Application Block, there are two HandleException() method signatures, and I am a bit lost on the intent for these, especially since neither the documentation, intellisense, nor the QuickStart apps intimate any meaningful diffe...

Is Objective-C 2.0 exception handling supported on non Mac OS X platforms?

Objective-C 2.0 has some new enhancements: garbage collection fast enumeration: for..in properties thread synchronization: @synchronized(self) @try/@catch/@finally/@throw exception handling I'm interested in using Objective-C 2.0 as a language to program portable code across multiple operating system platforms - while avoiding framew...

Why am I getting a System.Security.Permissions.SecurityPermission error in my .NET Application?

I am trying to develop a text-to-speech editor in .NET 3.5 using C#. I encountered the following exception: System.Security.Permissions.SecurityPermission. How to handle it? ...

SQL Performance - Better to Insert and Raise Exception or Check exists?

I'm considering an optimisation in a particularly heavy part of my code. It's task is to insert statistical data into a table. This data is being hit a fair amount by other programs. Otherwise I would consider using SQL Bulk inserts etc. So my question is... Is it ok to try and insert some data knowing that it might (not too often) ...

WSACleanUp causes an exception

My app can switch between Serial and Socket connections, but neither can be open at the same time. So when I try to switch between a Socket to Serial, I delete the Socket connection. The socket based object uses a private class called UsesWinsock (a big shout out to Len Holgate here as it is basically his code (it is RAII actually but I...

Can I have nested try-catch blocks in C++?

Can I have nested try-catch blocks? For example: void f() { try { //Some code try { //Some code } catch(ExceptionA a) { //Some specific exception handling } //Some code } catch(...) { //Some exception handling } }/...

Throwing/catching exceptions from C'tor of a static object in C++

Hi all, I have a case in which I have to read an input file in the C'tor, but sometimes this file doesn't exist. This object is usually held statically, so its C'tor is called while loading the dll. I can't catch the exception I throw if the file doesn't exist because it's too early, and my executable crashes in an ugly way. I know it's...

How to clear the memory allocated for Customized Exception

Hi All I have a customized exception class. say class CustomExcep{}; My Application is a middleware made of C++. It is a webservice which is used for the communication between Java based web Front-end and the DCE Backend. whenever the DCE Backend is not running or down due to some core dumps, the application throws the CustomExcep. I...

Exceptions in PHP - Try/Catch or set_exception_handler?

I'm developing some lower end code in my system that uses multiple child classes of the php exception class. Essentially I have the exceptions broken up to a few categories. What I'm wanting to do is two things. I need all exceptions that are fired in the application to be handled in a single place. I need to be able to log and the...

Is it bad practice for an object to catch its own exception and store the message in a property?

Let's say I have a list of objects of the same type. I want to iterate over that list of objects and execute a "dangerous" method on each of them. If an exception occurs in that method, is it bad practice to have the method itself catch the exception and set an error property on the object? Here's a quick example where the Start() m...

LINQ to SQL, Failed on db.SubmitChanges()

Im getting an Exception when I try updating, Insert works perfectly.. so this is: A first chance exception of type 'System.InvalidCastException' occurred in System.Data.Linq.dll Another cue... is possible to insert in one table first and then update another table and finally submitchanges() all in same code-block? I also comment InsertO...

Why is this groovy code throwing a MultipleCompilationErrorsException ?

I have the following groovy code : class FileWalker { private String dir public static void onEachFile(String dir,IAction ia) { new File(dir).eachFileRecurse { ia.perform(it) } } } walker = new FileWalker() walker.onEachFile(args[0],new PrintAction()) I noticed that if I place a def in front of walker , ...

UnauthorizedAccess in DynamicsSecurityConsole

In the DynamicsSecurityConsole (for administering the Dynamics Web Services), I'm having an issue trying to add users to new Role Assignments. Though my windows user is part of the Security Administrators defined at the top of the tree, I get an error trying to do anything with users, groups or roles. Each time I get an error message tha...

When is the last moment I can return an exception to a client in WCF?

Let's say I have this in an implementation of IInstanceProvider: public void ReleaseInstance(InstanceContext instanceContext, object instance) { try { unitOfWork.Commit(); } catch (Exception) { unitOfWork.Rollback(); throw; } finally { unitOfWork.Dispose(); } } That t...

Determining exception type after the exception is caught?

Is there a way to determine the exception type even know you caught the exception with a catch all? Example: try { SomeBigFunction(); } catch(...) { //Determine exception type here } ...