I had a C# .NET windows application having C# user interface and all the code behind processing is done by calling C++ dll (C++ class library project) which is added as a reference to the C# project.
However recently when I formatted my computer and again tried to run my project which was backed up, in visual studio 2005 it gave the fol...
I would like some tool, preferably one that plugs into VS 2008/2010, that will go through my methods and add XML comments about the possible exceptions they can throw. I don't want the <summary> or other XML tags to be generated for me because I'll fill those out myself, but it would be nice if even on private/protected methods I could ...
Hello! I have some kind of an ideological question, so:
Suppose I have some templated function
template <typename Stream>
void Foo(Stream& stream, Object& object) { ... }
which does something with this object and the stream (for example, serializes that object to the stream or something like that).
Let's say I also add some plain wr...
Possible Duplicate:
C++ - Arguments for Exceptions over Return Codes
While you are doing C++ programming, you have two choices of reporting an error. I suppose many teachers would suggest you throw an exception, which is derived from std::exception. Another way, which might be more "C" style, is to return a non-zero value, as ...
Hi,
I have a WCF service that throws an exception.
I get a FaultException in the client without an InnerException.
I only have part of the callstack of the original exception, from which it's hard to understand what caused this.
How do I get the original exception or at least all the callstack?
Thanks.
...
i have some business logic that traps some logically invalid situations, e.g. trying to reverse a transaction that was already reversed. In this case the correct action is to inform the user:
Transaction already reversed
or
Cannot reverse a reversing transaction
or
You do not have permission to reverse transactions
or
...
For the love of all things holy, how do you distinguish between different "exception flavors" within the predefined .NET exception classes?
For example, a piece of code might throw an XmlException under the following conditions:
The root element of the document is NULL
Invalid chars are in the document
The document is too long
All o...
As you may know rake swallows the full backtrace on uncaught exception. If I want to have a full backtrace, I need to add the --trace option. I find this very annoying because some of my tasks take long time to run (up to 6 hours), when it crashes I don't have any debugging info. I need to run it again with the --trace. On top of that,...
Let's say I have this sub in vb.net:
''' <summary>
''' Validates that <paramref name="value"/> is not <c>null</c>.
''' </summary>
'''
''' <param name="value">The object to validate.</param>
'''
''' <param name="name">The variable name of the object.</param>
'''
''' <exception cref="ArgumentNullExcepti...
A colleague of mine sets reference to null in finally blocks. I think this is nonsense.
public Something getSomething() {
JDBCConnection jdbc=null;
try {
jdbc=JDBCManager.getConnection(JDBCTypes.MYSQL);
...
}
finally {
JDBCManager.free(jdbc);
jdbc=null; // <-- Useful or not?
}
}
What...
I need to check whether the request will return a 500 Server Internal Error or not (so getting the error is expected). I'm doing this:
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "GET";
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
if (response.StatusCode == HttpStatusC...
Hi,
I am currently developing a REST web service with Jersey / Tomcat (but a generic Servlet/Container answer is welcome).
If the client does some GET requests on services that return large amount of data, from a MySQL connection.
To avoid any OOM exception, I use a streaming mode for MySQL.
However, if the client aborts the request ...
I'm using the Application.ThreadException event to handle and log unexpected exceptions in my winforms application.
Now, somewhere in my application, I've got the following code (or rather something equivalent, but this dummy code is enough to reproduce my issue) :
try
{
throw new NullReferenceEx...
Hi,
How is it possible to resume code execution after an exception is thrown?
For exampel, take the following code:
namespace ConsoleApplication1
{
class Test
{
public void s()
{
throw new NotSupportedException();
string @class = "" ;
Console.WriteLine(@class);
...
f# interactive throws System.OutOfMemoryException when loading large objects into memory.
Exception is thrown at approximately 1.3 gigs. Data set is 2.2 gigs, and loads fine in debugger mode.
Using VS2008 with April 2010 CTP
This is mostly a java library that is being used via ikvmc, but if that were an issue, it shouldn't be running ...
I need some help with my program. I get this error when I run my VB.NET program with a custom DayView control.
***** Exception Text *******
System.NullReferenceException: Object reference not set to an instance of an object.
at SeaCow.Main.DayView1_ResolveAppointments(Object sender, ResolveAppointmentsEventArgs args) in C:\Us...
I want to loop through a collection of objects and add them all to a table. The destination table has an auto-increment field. If I add a single object there is no problem. If I add two objects both with the primary key of zero, the entity framework fails. I can manually specify primary keys but the whole point of trying the EF was t...
Hi,
I am trying a simple C# Restful Webservice example. I have the service running. I create a console client to test the Webservice, i get the following exception:
Unhandled Exception: System.ServiceModel.CommunicationException: Internal Server Error
Server stack trace:
at System.ServiceModel.Dispatcher.WebFaultClientMessageInspec...
My class library is compiled against .NET 2.0 and works just fine whenever I try to load it as a plugin under the 2.0 runtime. If however the master application is running the .NET 4.0 runtime, I get an exception as soon as the resources need to be accessed:
Exception occurred during processing of command: Grasshopper
Plug-in = Grasshop...
When I run
Thread.abort_on_exception = true
threads = []
threads << Thread.new do
loop { sleep 1 }
end
threads << Thread.new do
loop { sleep 1; raise }
end
threads.each { |t| t.join }
as a straight-up ruby script, the script exits as you'd expect with abort_on_exception set to true.
But when I try to run this same code as a ra...