cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Gallardo Rivera <agalla...@agsoftware.dnsalias.com>
Subject [SUMMARY?] How to parse an error
Date Tue, 03 Sep 2002 08:46:58 GMT
Hi,

The first but not the best solution I found was using i18n to parse all the 
string. Obviously this is not the best way to do that.

I think a little enhancement to Cocoon can be a better parsing of the errors 
like this:

"org.apache.cocoon.ProcessingException: Could not add record:
java.sql.SQLException: ERROR: Cannot insert a duplicate key into unique
index categoria_cat_name_key"

....to something better like:

<errors>
	<count>2</count>
	<error>
		<number>1</number>
		<source>
			org.apache.cocoon.ProcessingException
		</source>
		<message>
			Could not add record
		</message>
	</error>
	<error>
		<number>2</number>
		<source>
			java.sql.SQLException
		</source>
		<message>
			Cannot insert a duplicate key into unique
			index categoria_cat_name_key
		</message>
	</error>
</errors>

Regards,

Antonio Gallardo


El Sábado, 31 de Agosto de 2002 04:51, Antonio Gallardo Rivera escribió:
> Sorry, I forgot told that the formValdator logicsheet and the DB Action are
> working well. The category_name has set UNIQUE attribute. Then if I try to
> write a second register in the database with the same name, when it process
> the request it throw the error. (Its true because the DB does not allow
> another "category_name" field with the same attribute.
>
> My goal is process the error to make it more user-friendly.
>
> El Viernes, 30 de Agosto de 2002 23:23, Antonio Gallardo Rivera escribió:
> > Hi,
> >
> > What can use to parse the error strings to make it more suitable to my
> > language.
> >
> > I am building a Database web application and I need to parse the error to
> > the user:
> >
> > From (error:description):
> >
> > org.apache.cocoon.ProcessingException: Could not add record:
> > java.sql.SQLException: ERROR: Cannot insert a duplicate key into unique
> > index categoria_cat_nombre_key
> >
> > To (string to the user):
> >
> > Cannot insert a duplicate key into unique index "category_name"
> >
> > Regards,
> >
> > Antonio Gallardo
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question  has not already been answered in the
> > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> > For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message