Class: Vintage::ErrorReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/vintage/errors.rb

Overview

A class to render the default error pages. These will not render if error pages are specified in the configuration.

Constant Summary collapse

CSS =

CSS shared among error templates

"""
  body { margin: 0px; padding: 0px; font-family: sans-serif; }
  h1 { background: #3E2B09; padding: 45px 10px 10px 10px; color: #6F5E3C;  border: 0px; border-bottom: 2px solid #1C0907; margin: 0px; }
  h1 span.error { text-shadow: 0.1em 0.1em #333; color: white; }
  h2 { margin: 0px; padding: 5px 5px 10px 10px; font-size: 14pt !important; }
  h2 span.where { color: #999; }
  h3 { margin: 0px; padding: 10px 10px; color: #999;}
  ul { margin: 0px; }
  li { margin: 0px; padding: 0px 30px; }
  pre { padding: 0 30px; margin: 0px; }
"""

Class Method Summary collapse

Class Method Details

.internal_error(error, params) ⇒ Object

Standard template to render for a 500 Internal Server Error



19
20
21
# File 'lib/vintage/errors.rb', line 19

def self.internal_error(error, params)
  error_page("500 Internal Server Error", error.class.to_s, "500 Internal Server Error", error.message.to_s, "at #{error.backtrace[0]}", "<h3>Backtrace</h3>\n\t<pre>#{error.backtrace.join('\n')}</pre>", params)
end

.not_found(url, remote_ip, params) ⇒ Object

Standard template to render for a 404 Page Not Found error



24
25
26
# File 'lib/vintage/errors.rb', line 24

def self.not_found(url, remote_ip, params)
  error_page("404 Not Found", "Page Not Found", "404 Not Found", "Request for #{url}", "from #{remote_ip}", params)
end