Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2007-02-27 : 23:21:32
|
when we have a global try catch and a lot of small try ctahes insode the code. How do I get the embeded error that causes an error if this exception is many levels inside the code?Thanks |
|
dfiala
Posting Yak Master
116 Posts |
Posted - 2007-02-27 : 23:46:09
|
Walk the inner exception until can't walk any more....Catch(Exception Ex){ Exception InnerMostException = Ex; while(InnerMostException.InnerException != null) { InnerMostException = InnerMostException.InnerException; } }Dean FialaVery Practical Software, IncNow with Blogging...http://www.vpsw.com/blogbabyMicrosoft MVP |
|
|
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2007-03-01 : 10:35:15
|
good idea. Thank Dean |
|
|
|
|
|