cake-php@googlegroups.com
[Top] [All Lists]

CakePHP; Exceptions and Errors

Subject: CakePHP; Exceptions and Errors
From: euromark
Date: Tue, 18 Jan 2011 09:54:48 -0800 PST
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 cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

<Prev in Thread] Current Thread [Next in Thread>
  • CakePHP; Exceptions and Errors, euromark <=