8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/waitress/handlers/handler500.rb', line 8
def self.trigger client, server, error, backtrace
begin
client.write "HTTP/1.1 500 Internal Server Error\r\n"
client.write "Content-Type: text/html\r\n"
client.write "\r\n"
client.write "<center> <h1> 500 </h1> <h2> Internal Server Error </h2>"
if backtrace
client.write "<h3> Error Backtrace: </h3>"
client.write "<div style='text-align: left; width: 50%'>"
client.write "<p> #{error.backtrace.join '<br>'} </p> </div>"
end
client.write "<hr /> <h5> Waitress HTTP Server Version #{Waitress::VERSION} </h5> </center>"
client.close
rescue => e
end
end
|