misd-service-development / raven-bundle

Adds Raven authentication to your Symfony2 application
1 stars 1 forks source link

Throw exceptions properly #10

Closed thewilkybarkid closed 11 years ago

thewilkybarkid commented 11 years ago

Adds individual exceptions and does a redirect to prevent the user from seeing ?WLS-Response (so when refreshing the page the response isn't reused). Fixes #4.

thewilkybarkid commented 11 years ago

Found a problem with this. I had a PDOException thrown (due to some incorrect user provider config) which isn't serializable (it ends up just returning 'You cannot serialize or unserialize PDO instances', masking the actual exception).

Using Symfony\Component\HttpKernel\Exception\FlattenException might solve this, if it's possible to turn it back into a real exception.

thewilkybarkid commented 11 years ago

I don't think that is going to be possible. A solution, however, would be to store the WLS-Response in the session instead, then let exceptions be thrown normally after the redirect. That would simplify things too (eg removes the need for RavenExceptionListener).

StuBez commented 11 years ago

That all seems good to me.