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

fREW Schmidt frioux at gmail.com
Wed May 30 12:56:57 GMT 2012


I've actually worked on and off on such a thing, called
DBIx::ParseException or something like that.  The idea is to introspect
error strings, error codes, and whatever else we get from a given database
handle to give the user a structured exception object.  This is the repo:
https://github.com/frioux/DBIx-Exceptions

If you'd like to toy with it feel free to message me on irc and we can talk
about where to go with it next.  Or email me off list.

On Wed, May 30, 2012 at 3:31 AM, 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?
>
> (Yes, the plans are to validate some user input in JavaScript, but a
> requirement is that the system work without JavaScript. I could also write
> wrapper functions that separately validate the data before submitting it,
> but that seems to be a duplication of work.)
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>



-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120530/06e=
1e9f1/attachment.htm


More information about the DBIx-Class mailing list