I've been there too… Catching this exception will work when you use the right namespace, watch out for the starting slash:
catch (\Cartalyst\Sentry\Users\UserExistsException $e){ //do your thing; }
Question
I am using Sentry and 'catch' to catch errors:
catch (UserExistsException $e)
{
return Redirect::back()->withInput()->with('error',$e->getMessage());
}
My redirect does not work though, it goes to the Laravel error screen with the right error message error "Cartalyst \ Sentry \ Users \ UserExistsException A user already exists with login [email@email.com], logins must be unique for users." with REDIRECT_STATUS 200.
Any ideas what I am doing wrong?
No correct solution
OTHER TIPS
I've been there too… Catching this exception will work when you use the right namespace, watch out for the starting slash:
catch (\Cartalyst\Sentry\Users\UserExistsException $e){ //do your thing; }
Ah - I see that exceptions now are really there as a last resort, I'll deal with it better in validation and catch it there.