Answers.Body: <p>If you put a <code>500.html</code> template in your <code>craft/templates</code> folder, then that will get displayed on the front end when a exception bubbles all the way to the top.  The same will work for other HTTP status codes as well (<code>404.html</code>, <code>503.html</code>, etc.).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T20:01:27.120Z
Answers.Text: Subject to the [errorTemplatePrefix setting](http://buildwithcraft.com/docs/config-settings#errorTemplatePrefix)
Answers.UserDisplayName: Marion Newlevant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-04T16:45:52.160Z
Answers.Text: Do 3XX responses throw an exception?
Answers.UserDisplayName: ponies
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T16:49:27.557Z
Answers.LastActivityDate: 2015-05-18T16:49:27.557Z
Answers.UserDisplayName: Brad Bell
Body: <p>So I have some exceptions being caught in a plugin, and have to assume that in some cases a 500 error is going to occur at some point.</p>
  
  <p>How can we set up Craft so that a server error displays a template rather than the default message display (assuming devMode is OFF)?</p>
  
  <p>This would be something we'd want working across the whole site, not just on one plugin.</p>
  
Tags: <plugin-development><templating><error>
Title: How can I handle exceptions on the front end
ThreadText: # How can I handle exceptions on the front end
  
  (Asked by: username_0 on 2015-05-18)
  
  So I have some exceptions being caught in a plugin, and have to assume that in some cases a 500 error is going to occur at some point.
  
  How can we set up Craft so that a server error displays a template rather than the default message display (assuming devMode is OFF)?
  
  This would be something we'd want working across the whole site, not just on one plugin.
  
  **Tags:** plugin-development, templating, error
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-18. Score: 2 | Accepted answer
  
  If you put a `500.html` template in your `craft/templates` folder, then that will get displayed on the front end when a exception bubbles all the way to the top. The same will work for other HTTP status codes as well (`404.html`, `503.html`, etc.).
  
  > **Comments:**
  > **username_2**: Subject to the [errorTemplatePrefix setting](http://buildwithcraft.com/docs/config-settings#errorTemplatePrefix)  
  > **username_3**: Do 3XX responses throw an exception?  
  
  ---
  
  