Subjects
Home
mod jk2 https
Donation of JAXP 1 3 Sources to Apache
R annoyances
RE: Finding out when the aspnet admin worker process has recycled
Favorite Linux Distribution
eigenvalues of a circulant matrix
Apache Install
Reachin apache from outside
Ant should have an ext directory
Warning: Documentroot doesn 't exist
Can this be Done?
RE: Multilanguage Application
RE: Simple Question On setting up Sub Domain site
Lack of independence in anova()
How to close connection instead of sending 403?
winning the case for ANT
Re: adding php
New Ant GUI 'Ant 's Nest '
Narrowing Down A Strange Problem
Ant Task: sshexec
R Graph Gallery : categorization of the graphs
I 've been hacked, I need some help please
RE: Anyone working with DotNetNuke?
RE: Exception Handling Opinion
hex format
RE: IIS stopped working :(
<for > Build Failed:problem
RE: Separation of Objects from Logic
RE: Tracking pages with long request execution time
sending email to multiple destination
Web Site
ant UI
Easy cut & paste from Excel to R?
Win32 Apache Restart
Improving Tasks
HELP! PLEASE!
RE: Adding Controls to a Page
read table
RE: ASPNET account doesn 't exist!
Best way to uninstall Apache2 on red hat
from win to linux how to web page
XMLParseException changes and creation of XMLLocator2
Re Post: rewrite backslash to forward slash
Target or macrodef?
Page display problem XPSP2
Authentication problems
Dynamic Dictionary Data Type?
Newbie unable access my www from outside
off topic question: Latex and R in industries
Conflict between xtable and Hmisc when using Sweave?
Very old problem without any new solution
mod rewrite help
Basic Authentication question
RE: Code Security
calling ant from java program
prevent double signing
Re: Controlling Copy/Paste/Print
Using R to illustrate the Central Limit Theorem
web server slow too much slow
access to user directories
Links
Home
Official R Project Site
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
RE: Exception Handling Opinion

RE: Exception Handling Opinion

2004-12-13       - By Tim Weaver
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

I've been going over something very similar. We already have an
infrastructure that allows customized messaging so the question for us
what is the best way to get that message to the UI. The problem with
exceptions is that we were seeing developers use:
catch(Exception ex)
{
string error = ex.Message;
}
and then add the error string to the page. This is a really dangerous
way to go (IMO). There is no guarantee that the information returned
from the message property should be shown to the user. It is a big
security risk to just blindly reflect error messages.

The solution we ended up with is that we created custom exception(s).
The base custom exception overrides the Message property and returns
the "messagized" text. This way the developers can do
catch(SafeException ex)
{
string error = ex.Message;

}
and always know that they will be given back text to show to the end
user. They don't catch anything except the base exception and those
derived from it. All other exceptions go to a generic error page that
logs the issue and tells the user we had a problem.







On Mon, 13 Dec 2004 11:39:41 -0500, Jason Gaylord
<jgaylord@(protected)> wrote:
> I am creating a new web application where I want to allow some end users to
customize messages for specific business rules. For instance, if a user
attempts to login, I want to kick off an exception. Then, the user would be
shown a customized message.
>
> I figure I need an HttpHandler to effectively handle the message portion.
However, I can't think of a good solution to raise an error or throw an
exception. I have other exceptions such as a 404.
>
> Any suggestions?
>
> Best Regards,
> Jason N. Gaylord
> Microsoft MVP, ASPInsider
> http://www.jasongaylord.com
> jgaylord@(protected)
> ---
> [This E-mail scanned for viruses by Declude Virus]
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>


Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com