|
and Chome is very very buggy!
I don't think so. I also used Chrome on Ubuntu tool.
|
|
|
|
|
|
|
Not with the Data collection. And in some cases I fill a DataTable with the Exception and its InnerExceptions, one per row. There can be other reasons to investigate each as well.
See also this recent Tip: Simple Log[^]
You'll never get very far if all you do is follow instructions.
modified 20-Jun-14 18:17pm.
|
|
|
|
|
My default thinking on this would be recursion.
LogException (Exception ex)
{
if( ex ==null )
return;
LogException( ex.innerException );
}
|
|
|
|
|
Recursion is unnecessary and could lead to a stack overflow; best to avoid it here. If an Exception had a collection of InnerExceptions, I would probably use recursion.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
PIEBALDconsult wrote: Recursion is unnecessary and could lead to a stack overflow;
If your exceptions have recursed infinitely to lead to a stack overflow when drilling into InnerException, then I think you have a much bigger problem.
Marc
|
|
|
|
|
PIEBALDconsult wrote: But VB doesn't support that construct, does it? In a similar way that C# only allows throwing exceptions
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
What else would you throw?
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
20[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I like it. Now I have something else to add my (short) list of things I don't like about C# and .net .
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Yes, we must strive to make the code obfuscated; that way it will be less maintainable in the future.
Oh, and don't forget to not document what you're doing and why.
|
|
|
|
|
Oh. Sorry. I'll get right on that.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
not to break your enthusiasm for everything looping but... how about?
exception.GetBaseException()
Go ahead, look it up!
|
|
|
|
|
How would that help?
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Well, if my English and the documentation didn't work for you, maybe the code will?
class Program
{
static void Main(string[] args)
{
Do(() => M(null, "one"));
Do(() => M(() => M(() => M(null, "three"), "two"), "one"));
Console.ReadLine();
}
static void M(Action a, string err)
{
try { if (a != null) a(); }
catch (Exception e) { throw new Exception(err, e); }
throw new Exception(err);
}
static void Do(Action a)
{
try
{
a();
Console.WriteLine("All Good");
}
catch(Exception e)
{
var @base = e.GetBaseException();
var top = e;
while (top.InnerException != null)
top = top.InnerException;
Console.WriteLine("Exceptions!\t e == base {0}, top == base {1}", e == @base, top == @base);
}
}
}
|
|
|
|
|
I know what it does, but the point is to log all the exceptions, not just the first and last.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Oh well, it was not apparent in your example that you wanted to log all intermediary exceptions...
Arguably it's not really necessary either, what do these intermediary exception tell you that you need to fix?
|
|
|
|
|
In fact logging isn't as inportant as visiting, for whatever reason, logging is just one reason. And the intermediate exceptions may have things in their Data collections that the end ones don't have. You'll never know unless you visit them all.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
HO, I see....
I used this Data collection once, myself! ^^
(this was the only time I saw something in it!! )
|
|
|
|
|
That's nothing. I do it with an if and a goto .
/ravi
|
|
|
|
|
Why bother when you can do:
On Error Resume Next
|
|
|
|
|
There are some amazing video snippets from around the world.........there are also a number of different video effects/techniques that have been applied to spectacular ends.
I've said enough......just sit back and enjoy.
https://www.youtube.com/watch?v=Tt4QjHdT3lU[^]
|
|
|
|
|
When I spotted this on the homepage of CP I was convinced it would be some muscle enhancement BS lol, but cool video
|
|
|
|
|
Awesome video, powerful music; is there any way to get rid of the dreadful vocals that destroy the whole thing?
Will Rogers never met me.
|
|
|
|