[Dbix-class] Is there a framework for translating raw database errors into human-readable errors

Patrick Meidl patrick at pantheon.at
Wed May 30 10:47:30 GMT 2012


On Wed, May 30 2012, Robert Rothenberg <robrwo at gmail.com> wrote:

> I am working on a web application and would like to translate (Postgres)
> database error messages into human readable forms, e.g. catching errors like
> 
>   qr/null value in column "name" violates not-null constraint/
> 
> and returning a message to the user like
> 
>   The Name field cannot be blank.
> 
> Before I write my own, is there an existing framework?

most form handling modules do validation for you. I use
HTML::FormHandler (in a Catalyst app, but you should be able to use it
with any other framework or plain cgi, too) which does input validation
with customisable error messages.

HTH

    patrick

-- 
Patrick Meidl ........................ patrick at pantheon.at
Vienna, Austria ...................... http://gplus.to/pmeidl




More information about the DBIx-Class mailing list