title: Validate duplicate entry using assert - Symfony/API-Platform
body: <p>When I am creating user, I have managed to validate email (not blank and format).</p>
  
  <p>The problem comes when I type the same email as an another user already have. Symfony will return 500 error with the query (in dev mode) and without query in production mode instead of returning 400 error with some proper description. </p>
  
  <p>In production mode I don´t have even chance to parse the error message to show user that email he entered already exists in the database.</p>
  
  <p>I am surprised that there is no assert for it. </p>
  
  <p>How should I deal with it?</p>
  
  <p>Thank you</p>