fix issue #2031 display the error message and not the trace

Update taken from the FOSUserBundle.