← Back to team overview

openerp-expert-framework team mailing list archive

Re: Errors handling

 

Hello,

I also recommend issuing more user friendly messages, but only if that could
be done in a generic manner. I would be sad if the solution was to dilute
non-consitent/unmaintainable exception messages all over the place in every
possible case.

While trying to interpret the error, may be the stack and/or the ir_model
and/or ir_model_fields table could be used to help build a user friendly
message. Not sure this is easy, in the meantime, let's just require some
minimal tech skills from the customers until a clean solution can be made.

But notice that, in Rails you would generate such model data integrity
controls with human messages at the model layer for that. It's much like the
field declaration in the objects will generate specific validations at the
model layer when trying CRUD operations, may be it's the way to go
(strangely I was dealing with that yesterday in Rails).

Raphaël Valyi
http://www.akretion.com

On Sun, Jan 24, 2010 at 6:24 PM, Albert Cervera i Areny
<albert@xxxxxxxxxxx>wrote:

> A Diumenge, 24 de gener de 2010, Davide Corio va escriure:
> > Hello Experts,
> >
> > one of the most important issues, in our customers' opinion, is the
> > openobject's errors handling.
> >
> > Let me give you an example.
> >
> > Create a category, create a product and then put this product inside the
> > previously created category.
> > Now, delete that product and try to delete the category.
> >
> > OpenObject throws an exception because there is a product template still
> > associated with that category
> >
> > -----------------------------------------------------------------------
> > Integrity Error
> >
> > null value in column "categ_id" violates not-null constraint
> > CONTEXT: SQL statement "UPDATE ONLY "public"."product_template" SET
> > "categ_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "categ_id""
> > -----------------------------------------------------------------------
> >
> > In this case a user has to ask a technician to solve the problem, mainly
> > because he cannot understand the error message.
> >
> > Instead of that message, openobject should say something like "In order
> > to delete this category you must first delete every related products.
> > Click here to view the list of related objects".
> >
> > With this information, the client is able to solve the problem by
> > himself.
> >
> > I'd like to have your opinion and suggestion before i start to code some
> > possibile workarounds
>
> Nice to  know you'll be working on this!
>
> I think if OpenObject could parse PostgreSQL exceptions and convert them
> into
> intelligible messages, even if it only was:
> """
> You can not leave field "Category" of "Product Template" empty.
> """
> that would be a good start!
>
> >
> > best regards,
> >
>
>
> --
> Albert Cervera i Areny
> http://www.NaN-tic.com
> Mòbil: +34 669 40 40 18
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-framework
> Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-framework
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References