title: PHP Exceptions redirected to custom error page
body: <p>The functions I have written are throwing exceptions if they can't do their job. For the productive environment I thought to redirect the exception to a nice looking error page. Therefore I'm thinking of setting the exception handler <code>set_exception_handler</code> on the beginning of every script. How does the error page know which error occured? I thought of putting an error code into the URL like <code>header("Location: error.php?code=1234")</code>. While in the development phase I just would not set the exception handler, thus every exception would be printed onto the php default error screen <em>Uncaugt Exception: ...</em> with all usefull informations.</p>
  
  <p>I have read <a href="https://stackoverflow.com/questions/557052/exceptions-in-php-try-catch-or-set-exception-handler">Exceptions in PHP - Try/Catch or set_exception_handler?</a> but don't know how to write a front controller script and also think this is maybe to much the effort.</p>
  
  <p>I'm a PHP beginner who likes to handle errors in the right way, but I'm just not sure if I'm doing it right or wrong. Do you think it's ok doing it like above described or do you have other suggestions?</p>
  
  <p>Thank you!</p>