Questions tagged [inner-exception]

An exception thrown and wrapped in another exception.

An exception thrown and wrapped in another exception. It can be property of current exception.

34 questions
200
votes
11 answers

What is the proper way to display the full InnerException?

What is the proper way to show my full InnerException. I found that some of my InnerExceptions has another InnerException and that go's on pretty deep. Will InnerException.ToString() do the job for me or do I need to loop through the InnerExceptions…
Willem
  • 9,166
  • 17
  • 68
  • 92
33
votes
3 answers

What is inner Exception

I have read the MSDN but, I could not understand this concept. Correct me if I am wrong, A innerexception will be used in hand with current exception. Inner exception will occur first and then the current exception will occur (if there is an…
user2526236
  • 1,538
  • 2
  • 15
  • 29
22
votes
3 answers

How to rethrow the inner exception of a TargetInvocationException without losing the stack trace

I have many methods which are calling using Delegate.DynamicInvoke. Some of these methods make database calls and I would like to have the ability to catch a SqlException and not catch the TargetInvocationException and hunt through its inners to…
5
votes
1 answer

Properties of Inner Exception are Disposed?

I am writing a unit test for a WCF web service. I am deliberately sending an invalid request to the server which throws a WebExceptionFault. In the unit test, the Exception that gets caught is an EndpointNotFoundException with the standard…
Clivest
  • 499
  • 1
  • 4
  • 14
4
votes
1 answer

Check InnerException in System.TypeInitializationException thrown by an external code frame

Using Visual Studio 2012 Express, how can I check the InnerException when a System.TypeInitializationException is raised from an external code frame. The debugger breaks due to the exception, however not at any code line. It gives the following…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
4
votes
6 answers

How can I make this call to log my exceptions recursive?

I have the following code: protected string formatException(Exception e) { var exError = "
"; if (e == null) { throw new ArgumentNullException("e"); } exError += "
"…
Samantha J T Star
  • 30,952
  • 84
  • 245
  • 427
3
votes
1 answer

How can I get Inner Exception text from Test Results run on TFS 2010

I have some MSTest unit tests that are running just fine on my machine but are failing in my autobuild. The error gives a generic fault exception then says "See the inner exception for details". Normally I would just run the test then examine the…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
3
votes
1 answer

How to unit test code with inner exceptions?

I would like to get some unit test coverage on the following code: public static class ExceptionExtensions { public static IEnumerable SelfAndAllInnerExceptions( this Exception e) { yield return e; while…
GregC
  • 7,737
  • 2
  • 53
  • 67
2
votes
1 answer

Catch exceptions in multi threads and processes program

I'm trying to catch some specific exception. The problem is that my program is complex and can hide this exception as a 'primary' exception or as an inner exception inside an aggregated exception. (it could also be an inner of an inner exception and…
Nika
  • 57
  • 7
2
votes
1 answer

Unable to control the every content of an Exception object (location not available)

I have a method for manually causing the application to crash for testing purposes. It works as supposed to and the custom error page appears just as I want it to. However, I noticed that while the outer exception (i.e. the exception) provides info…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
2
votes
1 answer

xaml parse exception issue only on win7

I have an issue where I got error id 1000 (KERNELBASE.dll) and error id 1026 System.IO.FileNotFoundException When I try to run my program on Win 7 (witch had run fine before), but it runs perfectly on win 8/8.1/10. I am running .Net Framework…
shawn
  • 93
  • 1
  • 9
2
votes
1 answer

Error when trying to update a Currency field in C#

I'm trying to update the invoice field "freightamount" from my C# code. I'm able to update other fields well like strings and Guid but for Money I get this error on creating or updating the invoice entity: There was an error while trying to…
user3340627
  • 3,023
  • 6
  • 35
  • 80
2
votes
0 answers

Is there anything wrong with my self-implemented exception class?

I wrote my own exception class, deriving from std::runtime_error to have Error-IDs, timestamps and inner exceptions. It seems to work, but are there any drawbacks? The only thing I see is the deep-copy in the copy-constructor, which is not…
Ben
  • 4,486
  • 6
  • 33
  • 48
1
vote
2 answers

InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Int32'

I am trying to display the result from the database to the user on the front end but I keep getting the following exception: InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Int32' and…
Gh17
  • 76
  • 2
  • 9
1
vote
2 answers

Checking inner exceptions in VS2010

Probably an obvious question from a programming novice: I'm debugging a Silverlight project in Visual Studio 2010. How/where do I check the "inner exception"? Is this something I select under "Debug"? UPDATE: I'm trying to figure out why I started…
1
2 3