Click here to Skip to main content
16,022,924 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone please help me to know in what all the conditions a system exception is thrown.
try {
...
}catch (const std::exception & e) {
printf( "failed(%s)",e.what());
}

output-- failed(system exception).

I searched in net and came to know that this is generic exception.


Can anyone help me to find the reason for system exception. also, the code changes for the the detailed reason for it

Thanks in advance.
Posted
Updated 24-Nov-15 0:12am
v2
Comments
Jochen Arndt 24-Nov-15 5:19am    
This can't be answered without knowing what is called inside the try block.

The common way to find out is reading the documentation for each function that is called and check if that might throw the exception. To reduce the number of possible candidates, just comment out portions of the code.

BTW:
You have tagged your question as C++ and Linux but refer to C# in your question. Please remove or correct the non-related parts.

1 solution

Start by looking at the exception object in the debugger.
Does it have a message? A stack trace? An Inner Exception?

You need to use the debugger to look at exactly what is happening - a generic exception is just that: generic. And we can't tell you "it happens because of this" because it is generic - it could be any cause. We can't even see your code, much less run it and find out for you!
 
Share this answer
 
Comments
CPallini 24-Nov-15 5:36am    
Have my generic 5.
Member 12018498 24-Nov-15 7:37am    
Thanks for the suggestion. I will add more debugs and check the reason. Unfortunately,I can't add the code in try block here, as it has methods which are part of other files. and bit huge :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900