Method exception location (from stack trace)?

Method exception location (from stack trace)?

Old forum URL: forums.lhotka.net/forums/t/2737.aspx


sgraham posted on Thursday, April 19, 2007

I'm using the BusinessException property of the DataPortalException to get the real exception.  However, I'm curious if there is a "clean" way to get the specific METHOD that threw the exception (not the CSLA method but my business object's method).  I can probably do a text scrape to get the info (since it's the last bit of text on the stack trace) but I was hoping for a cleaner method.  Anybody aware of one?

Thanks!

xal replied on Thursday, April 19, 2007

You can get the inner exception or call GetBaseException in order to get the original exception.

Andrés

sgraham replied on Thursday, April 19, 2007

Unfortunately, that stack trace of that still returns a very long string of text with each method "stop" of the exception as it is thrown from the CSLA classes.  I don't want to display those methods.  I only want my business class method with the error.

Copyright (c) Marimer LLC