You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Chiu, Dennis (Toronto - BCE)" <de...@ml.com> on 2006/02/27 22:18:20 UTC

Exception error message

Hi there:

When I display the getMessage() of the SQLException on the front-end
screen it looks like the following:

java.rmi.RemoteException:   
--- The error occurred in Abc.xml.  
--- The error occurred while applying a parameter map.  
--- Check the Abc.Abc_Param.  
--- Check the statement (update procedure failed).  
--- Cause: com.sybase.jdbc2.jdbc.SybSQLException: The entry you are
trying to save has been modified by another user, please refresh

Since Ibatis will automatically append some description in front of the
message of the original SQLException.
Is there any ways to suppress those added description?
The user just need to see the "Raise Error message" from the db.

Many Thx!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Dennis Chiu 
e-mail: dennis_chiu@ml.com 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------

Re: Exception error message

Posted by Nathan Maves <Na...@Sun.COM>.
Dennis,

Letting an exception trickle all the way to your user is generally a  
bad thing.  If it was me I would catch this exception and then pull  
the error message from some where else, say a resources file, and the  
display this to the user.

I have no clue what web framework you are using, if any, but this  
kind of thing is handled in the Action classes of the Struts framework.

Nathan
On Feb 27, 2006, at 2:18 PM, Chiu, Dennis (Toronto - BCE) wrote:

> Hi there:
>
> When I display the getMessage() of the SQLException on the front- 
> end screen it looks like the following:
>
> java.rmi.RemoteException:
> --- The error occurred in Abc.xml.
> --- The error occurred while applying a parameter map.
> --- Check the Abc.Abc_Param.
> --- Check the statement (update procedure failed).
> --- Cause: com.sybase.jdbc2.jdbc.SybSQLException: The entry you are  
> trying to save has been modified by another user, please refresh
>
> Since Ibatis will automatically append some description in front of  
> the message of the original SQLException.
> Is there any ways to suppress those added description?
> The user just need to see the "Raise Error message" from the db.
>
> Many Thx!
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dennis Chiu
> e-mail: dennis_chiu@ml.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> If you are not an intended recipient of this e-mail, please notify  
> the sender, delete it and do not read, act upon, print, disclose,  
> copy, retain or redistribute it. Click here for important  
> additional terms relating to this e-mail.     http://www.ml.com/ 
> email_terms/