Sha256: 1537f06eba4a3c00c1f360573930ee4e233ae620a843f3ca56723a8ea88723f1

Contents?: true

Size: 768 Bytes

Versions: 2

Compression:

Stored size: 768 Bytes

Contents

module Frank
  module Rescue
    
    def render_404
      template = File.expand_path(File.dirname(__FILE__)) + '/templates/404.haml'
      
      @response['Content-Type'] = 'text/html'
      @response.status = 404
      @response.body = tilt_lang(template, 'haml', Object.new, locals = { :request => @env, :params => @request.params })
      
      log_request('404')
    end
  
    def render_500(excp)
      template = File.expand_path(File.dirname(__FILE__)) + '/templates/500.haml'
      
      @response['Content-Type'] = 'text/html'
      @response.status = 500
      @response.body = tilt_lang(template, 'haml', Object.new, locals = { :request => @env, :params => @request.params, :exception => excp })
      
      log_request('500', excp)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
frank-0.1.1 lib/frank/rescue.rb
frank-0.1.0 lib/frank/rescue.rb