[symfony-users] Re: Handle form error in the action

2010-04-20 Thread WallTearer
Aaaargh, I've created custom PostValidator, but when I'm throwing my custom exception from that post validator, symfony catches it first, and I can not catch it in the action. I've tried to create custom exception class that extends sfValidatorError class (class sfValidatorLicenseError extends

[symfony-users] Re: Handle form error in the action

2010-04-20 Thread Marijn
$form-getErrorSchema() contains all validation errors thrown On Apr 20, 2:55 pm, WallTearer walltea...@gmail.com wrote: Aaaargh, I've created custom PostValidator, but when I'm throwing my custom exception from that post validator, symfony catches it first, and I can not catch it in the

[symfony-users] Re: Handle form error in the action

2010-04-20 Thread WallTearer
But how can I check if the needed error happened? Loop through the array of validation errors and check if the error was triggered by the needed Validator? Hope this is not the only way -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

[symfony-users] Re: Handle form error in the action

2010-04-20 Thread Richtermeister
Just throw a custom extension that doesn't extend sfValidatorError. After all, you are trying to break outside the form, so it's legitimate to use exceptions that transcend the form framework. Daniel On Apr 20, 7:52 am, WallTearer walltea...@gmail.com wrote: But how can I check if the needed

[symfony-users] Re: Handle form error in the action

2010-04-16 Thread WallTearer
Oh, missed your message. Thank you very much, I'll give a try for this approach. Thanks! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group.

[symfony-users] Re: Handle form error in the action

2010-04-13 Thread Richtermeister
Hey there, ah, ok. In that case I think throwing custom exceptions that extend the sfValidatorError would be in order. Just catch those in the actions, and depending on their type you'll know which error occurred. I'm doing something similar where in my setup the credit card validator can throw

[symfony-users] Re: Handle form error in the action

2010-04-12 Thread Richtermeister
Hey man, I know what you mean, for example - I have a checkout form that uses authorize.net to validate a credit card, but I don't want to trigger the validation until the basic for validation passes. The way I go about it is override the doBind method to first call the parent::doBind method, and

[symfony-users] Re: Handle form error in the action

2010-04-12 Thread WallTearer
Thanks a lot, Daniel, but in my case I have to trigger different functions depending on the results of validation. Lets say I have 2 fields: field_1 and field_2. If field_1 passed validation and field_2 didn't - action needs to trigger function a() and show default template. If field_2 didn't pass