Class: Camping::Controllers::ServerError
- Inherits:
-
Object
- Object
- Camping::Controllers::ServerError
- Includes:
- Base
- Defined in:
- lib/camping-unabridged.rb,
lib/camping.rb
Overview
The ServerError class is a special controller class for handling many (but not all) 500 errors. If there is a parse error in Camping or in your application’s source code, it will not be caught by Camping. The controller class k and request method m (GET, POST, etc.) where the error took place are passed in, along with the Exception e which can be mined for useful info.
module Camping::Controllers
class ServerError
def get(k,m,e)
@status = 500
div do
h1 'Camping Problem!'
h2 "in #{k}.#{m}"
h3 "#{e.class} #{e.}:"
ul do
e.backtrace.each do |bt|
li bt
end
end
end
end
end
end
Instance Attribute Summary
Attributes included from Base
#body, #cookies, #headers, #input, #root, #status
Instance Method Summary collapse
Methods included from Base
#method_missing, #r, #redirect, #render, #service, #to_s
Methods included from Helpers
#/, #R, #errors_for
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Camping::Controllers::Base
Instance Method Details
#get(k, m, e) ⇒ Object
30 31 32 |
# File 'lib/camping.rb', line 30 def get(k,m,e);r(500,markaby.div{h1 "#{C} Problem!" h2 "#{k}.#{m}";h3 "#{e.class} #{e.}:";ul{e.backtrace.each{|bt|li(bt)}}} )end |