Changeset 7 for lib/vintage
- Timestamp:
- 01/11/08 20:26:29 (9 months ago)
- Files:
-
- lib/vintage/errors.rb (modified) (1 diff)
- lib/vintage/request_context.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lib/vintage/errors.rb
r6 r7 18 18 # Standard template to render for a <tt>500 Internal Server Error</tt> 19 19 def self.internal_error(error, params) 20 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>" )20 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) 21 21 end 22 22 23 23 # Standard template to render for a <tt>404 Page Not Found</tt> error 24 24 def self.not_found(url, remote_ip, params) 25 error_page("404 Not Found", "Page Not Found", "404 Not Found", "Request for #{url}", "from #{remote_ip}" )25 error_page("404 Not Found", "Page Not Found", "404 Not Found", "Request for #{url}", "from #{remote_ip}", params) 26 26 end 27 27 28 28 private 29 29 # Standard template to render for a <tt>404 Page Not Found</tt> error 30 def self.error_page(title, h1_primary, h1_secondary, h2_primary, h2_secondary, extra_content = "" )30 def self.error_page(title, h1_primary, h1_secondary, h2_primary, h2_secondary, extra_content = "", params = {}) 31 31 """ 32 32 <html> lib/vintage/request_context.rb
r4 r7 33 33 self.response.cookies[key] = val 34 34 end 35 36 # def session 37 # @env["rack.session"] 38 # end 35 39 end 36 40 end
