tagged [exception]

Checking CustomErrors turned on in Code

Checking CustomErrors turned on in Code Is it possible to check weather custom errors is turned on or off in the code on web application runtime.

2 Sep at 13:16

Throwing NotImplementedException on default case in switch statement

Throwing NotImplementedException on default case in switch statement Should I throw a `NotImplementedException()` on `default`, if I have cases for all possible enum types?

12 Jan at 06:44

Which is correct? catch (_com_error e) or catch (_com_error& e)?

Which is correct? catch (_com_error e) or catch (_com_error& e)? Which one should I use? or

4 May at 20:20

Use a 'try-finally' block without a 'catch' block

Use a 'try-finally' block without a 'catch' block Are there situations where it is appropriate to use a `try-finally` block without a `catch` block?

24 Mar at 12:57

Why use finally in C#?

Why use finally in C#? Whatever is inside finally blocks is executed (almost) always, so what's the difference between enclosing code into it or leaving it unclosed?

13 Feb at 21:36

What are the pros and cons of checked exception?

What are the pros and cons of checked exception? Do you prefer checked exception handling like in Java or unchecked exception handling like in C# and why?

11 Apr at 06:14

Why wasn't the Java "throws" clause (in method declaration) included in C#?

Why wasn't the Java "throws" clause (in method declaration) included in C#? Why wasn't the Java "throws" clause (in method declaration) included in C#?

What is the difference between an error and an exception in .NET?

What is the difference between an error and an exception in .NET? Could you please explain to me what the difference is between an error and an exception?

12 Mar at 19:57

Exception throwing

Exception throwing In C#, will the folloing code throw `e` containing the additional information up the call stack?

16 Mar at 12:6

How can I throw an exception in C?

How can I throw an exception in C? I typed this into Google, but I only found how-tos in C++. How can I do it in C?

10 Jun at 12:20

What is the intended use of the optional "else" clause of the "try" statement in Python?

What is the intended use of the optional "else" clause of the "try" statement in Python? What is the intended use of the optional `else` clause of the `try` statement?

22 Mar at 18:15

How do I stop a program when an exception is raised in Python?

How do I stop a program when an exception is raised in Python? I need to stop my program when an exception is raised in Python. How do I implement this?

26 Dec at 04:56

How to write User Defined exceptions in C#?

How to write User Defined exceptions in C#? hi can any one tell me how to write user defined exceptions in C#?As we have in Java can we write in C#?

4 Oct at 04:54

What is difference between Errors and Exceptions?

What is difference between Errors and Exceptions? > [Differences betweeen Exception and Error](https://stackoverflow.com/questions/912334/differences-betweeen-exception-and-error) How can I differen...

23 May at 11:47

How to Trace all local variables when an exception occurs

How to Trace all local variables when an exception occurs any generic way to trace/log values of all local variables when an exception occurs in a method? (in C# 3)

12 Dec at 10:51

Difference between 'throw' and 'throw new Exception()'

Difference between 'throw' and 'throw new Exception()' What is the difference between and regardless that the second shows a message.

18 Aug at 14:26

How to serialise Exception to Json

How to serialise Exception to Json C# Exceptions are ISerialisable so they can't also be DataContracts so I can't use JsonDataContractSerializer. What are alternatives to serialising Exceptions to JSO...

12 Feb at 08:44

General Exception Handling Strategy for .NET

General Exception Handling Strategy for .NET I’m used to having try/catch blocks in every method. The reason for this is so that I can catch every exception at the point of infraction and log it. I un...

26 Jun at 18:11

How do I find the stack trace in Visual Studio?

How do I find the stack trace in Visual Studio? I ask because I couldn't find the stack trace in Visual Studio, while debugging an exception that occurred.

PHPUnit assert that an exception was thrown?

PHPUnit assert that an exception was thrown? Does anyone know whether there is an `assert` or something like that which can test whether an exception was thrown in the code being tested?

8 Nov at 15:41

C# equivalent to Java's Exception.printStackTrace()?

C# equivalent to Java's Exception.printStackTrace()? Is there a C# equivalent method to Java's `Exception.printStackTrace()` or do I have to write something myself, working my way through the InnerExc...

21 Jan at 00:52

Puzzling Enumerable.Cast InvalidCastException

Puzzling Enumerable.Cast InvalidCastException The following throws an `InvalidCastException`. Why? I'm using Visual Studio 2008 SP1.

15 Jan at 03:19

Mockito How to mock and assert a thrown exception?

Mockito How to mock and assert a thrown exception? I'm using mockito in a junit test. How do you make an exception happen and then assert that it has (generic pseudo-code)

25 Sep at 20:10

Get name of specific Exception

Get name of specific Exception Is this the best method for getting the name of a specific Exception in C#: It is in a generic exception handler:

7 Nov at 21:29

How to prevent an exception in a background thread from terminating an application?

How to prevent an exception in a background thread from terminating an application? I can hookup to `AppDomain.CurrentDomain.UnhandledException` to log exceptions from background threads, but how do I...

29 Nov at 11:49