Derik Whittaker

Syndication

News


Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
If at first you don't succeed, try/catch it again

I came across this gem today when I was rolling out an upgrade for one of our legacy web sites. 

try {
if(Request.QueryString.Get("skin").Length > 0)
	sSkinCode = Request.QueryString.Get("skin");
else
sSkinCode = GetSiteName();< } catch { sSkinCode = GetSiteName(); }

Can anyone see what is wrong with this?  Wanna guess where my code is failing?  Hope there is no exceptions thrown in GetSiteName().

Doh!

Till next time,


Posted 11-13-2007 1:57 PM by Derik Whittaker
Filed under:

[Advertisement]

Comments

Eber Irigoyen wrote re: If at first you don't succeed, try/catch it again
on 11-13-2007 5:01 PM

duh!!!... of course you needed another try..catch in the catch{} =oP

...your code renders fine in the RSS (google reader) but not good in the actual site (FireFox)

Eduardo Costa wrote re: If at first you don't succeed, try/catch it again
on 11-13-2007 7:06 PM

Hi, Derik.

I've seen that kind of code before too. And also something like this (is practically a "pattern"):

try{

// Do something

}catch{

throw;

}

Regards,

Eduardo Costa. :)

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)