WebFaction
Community site: login faq

What message page is displayed to the visitor when my Webfaction site encounters a MySQL "1040: Too Many Connections" error? (I have a Django site on a shared server). Is there any way to customize it?

asked 25 Aug '14, 15:00

xnx
113
accept rate: 0%


An error such as this would return a 500 response code, so your site will display either your custom 500.html template (if you have one), or the standard Apache "internal server error" page.

You can customize it by making your own 500.html template, along with some logic to detect the specific error you're targeting. There's some info here that might be helpful:

permanent link

answered 25 Aug '14, 17:58

seanf
12.2k41836
accept rate: 37%

edited 25 Aug '14, 17:59

Thanks for this. So I need to write a 500.html file, set handler500 = 'mysite.views.my_custom_error_view' and then write a method, my_custom_error_view to handle the specific Exception that caused the server error? What do I look for in the request object passed to my customized error view to check for this specific error?

(25 Aug '14, 18:18) xnx

You'll need to look in the contents of the traceback to identify the type of error - some examples of how to get to the traceback are in the StackOverflow post to which I linked in my answer.

(25 Aug '14, 18:22) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×168
×108
×4

question asked: 25 Aug '14, 15:00

question was seen: 1,876 times

last updated: 25 Aug '14, 18:22

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM