ArrayList allCults =
new ArrayList(CultureInfo.GetCultures(CultureTypes.AllCultures));
try{
// I know the framework will throw an exception here. CultureInfo ci=new
CultureInfo(badCultureName);
if (allCults.Contains(ci)){
//do something localized
}
}
catch(InvalidCultureNameExceptione)
{
// however the only InvalidCultureNameException I could find was in the MapPoint SDK.
//nothing in System.Globalization - Am I missing something? HttpContext.Current.Trace.Warn("My component",
"Invalid culture string passed in", e);
Member
22 Points
700 Posts
how can I throw and handle InvalidCultureNameException?
Jul 27, 2005 08:38 AM|rmprimo|LINK
// I know the framework will throw an exception here.
CultureInfo ci=new CultureInfo(badCultureName); if (allCults.Contains(ci)){
//do something localized
}
}
catch(InvalidCultureNameException e)
{
// however the only InvalidCultureNameException I could find was in the MapPoint SDK.
//nothing in System.Globalization - Am I missing something?
HttpContext.Current.Trace.Warn("My component", "Invalid culture string passed in", e);
//instead of
HttpContext.Current.Trace.Warn("My component", "Invalid culture string passed in", HttpContext.Current.Server.GetLastError().GetBaseException() );
}
Any tip appreciated
Rob
Rob
None
0 Points
15 Posts
Re: how can I throw and handle InvalidCultureNameException?
Dec 14, 2005 11:13 AM|David Banister|LINK
Member
22 Points
700 Posts
Re: how can I throw and handle InvalidCultureNameException?
Dec 14, 2005 01:54 PM|rmprimo|LINK
Wow this was months ago. Thank you.
They took away the drop down to mark a post as resolved for the c# forum.
Rob