Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Trying to get DBIx::Class::Result::Validation to work

by moritz (Cardinal)
on Sep 29, 2012 at 07:46 UTC ( #996352=note: print w/ replies, xml ) Need Help??


in reply to [more detail added] Trying to get DBIx::Class::Result::Validation to work

I've already said that in CB, but repeating it here for the benefit of others:

the error is getting set as expected, but it croaks rather than gets encapsulated somewhere

That part puzzles me. If a validation fails, I do expect it to throw an error. That gives you the opportunity to catch the exception wherever you want in your code, and deal with it there.

If it didn't throw the exception, but encapsulated it somewhere, would the operation just fail silently if the validation failed? And what would the calling code make of that? That doesn't strike me as a useful modus operandi.

(Disclaimer: I've never worked with dbic::Result::Validation, I'm merely applying my common sense here).

Update: Answer to a new question after OP's update:

However, I still can't work out how to get to the error data

I'd guess that the exception is an objet of type DBIx::Class::Result::Validation::VException, and you can use the message and object accessors.


Comment on Re: Trying to get DBIx::Class::Result::Validation to work
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996352]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-10-21 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (95 votes), past polls