Right now I would be happy if Cake used Exceptions

I would like this snippet to work
        try {
                $result = Validation::custom($this->params['form']['value'], 
$this-
>params['form']['validation']);
        }
        catch (Exception $e) {
                $message = $e->getmessage()."";
        }

Right now I can only suppress the error with @. But this way the
functions returns false for both valid and invalid regexp. therefore
the function itself does not work anymore as expected.
I can't catch the error of an invalid regexp and return a meaningful
error message - as well as return the success message of the
validation of the string itself.

My goal:
- return true/false for result if regexp is valid
- return the error "invalid Regexp" in case it is invalid - and omit
the result (meaningless in this context)

any ideas? i'm stuck

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to