Ayende @ Rahien

Refunds available at head office

Rant: Who thought THIS was a good idea?!

image

I means, seriously!

Even this is better:

Tags:

Posted By: Ayende Rahien

Published at

Originally posted at

Comments

Pablo Alarcón
09/08/2011 09:26 AM by
Pablo Alarcón

Looks like someone used the resource file key instead of the value ;)

Bryan Porter
09/08/2011 01:16 PM by
Bryan Porter

Could be worse. The Secure Store Service API in SharePoint 2010 likes to throw exceptions that are declared internal.

tobi
09/08/2011 01:54 PM by
tobi

Well at least it allows you to programmatically determine what the exact cause was ;-)

Curiously this is not the case for most exceptions. Especially IOException gives you about nothing to which you can react programmatically. There are not error codes.

justin chase
09/08/2011 03:57 PM by
justin chase

It's an aggregate exception, which couldn't have a useful message anyway. You have to go look into the exceptions that it has aggregated to get the useful messages. It's a property, just expand it.

Ayende Rahien
09/08/2011 04:27 PM by
Ayende Rahien

Justin, It could show me the exceptions that it had internally. In 99% of the cases, it only have a single exception, anyway

justin chase
09/08/2011 04:41 PM by
justin chase

Click the "View Detail" link and it will show you the exceptions it has aggregated.

Ayende Rahien
09/08/2011 04:52 PM by
Ayende Rahien

Justin, That assumes that I actually have the debugger there. And that is is responding. What about log messages, users errors, emails to the mailing list, all of which show that error.

justin chase
09/08/2011 06:34 PM by
justin chase

Your error logger would have to special case AggregateExceptions, that is a pain in the ass that's true.

Ayende Rahien
09/08/2011 07:45 PM by
Ayende Rahien

Justin, I would state that if your class need special handling, separate from all other classes of the same type, your class is broken

justin chase
09/08/2011 07:57 PM by
justin chase

Ayende, It seems like .ToString() will print out all of the aggregated exceptions still, so it should work with loggers fine (unless you have some type of custom formatter that does more than just ToString()'s the exception). It's only in the debugger that you'll see this issue. The message should say "One or more errors occurred." Which is sort of redundant considering the name of the Exception.

Ayende Rahien
09/09/2011 08:44 AM by
Ayende Rahien

Justin, Users see that all the time, that is the error that is thrown in VS. To find the real details, you have to dig deep, that isn't a nice thing to do to people

Comments have been closed on this topic.