Re: CakePHP 3 - Catch invalidargument email -> to exception

2016-02-07 Thread Artur Mamedov
Have the same problem with Carbon::createFromFormat() try { $this->app_from = $date->createFromFormat('Y-m-d', $this->request->cookie('app_from'));//$date->subDays(7);//date('Y-m-d', strtotime("-7 days")); $this->app_to = $date->createFromFormat('Y-m-d', $this->request->cookie('app_to'));

CakePHP 3 - Catch invalidargument email -> to exception

2015-12-29 Thread Willem
How can we catch an invalid email exception? Cake throws and invalidargumentexception. Invalid email: "bassdsd.cs#adcdc.com"InvalidArgumentException This does not work, the catch is not reached: $toEmailAddress = "bassdsd.cs#adcdc.com"; $email = new Email('default'); try { $email->t