Sha256: 0d7a9b1a678b762181d8a77c8713c90b8da714c40566d392a336f0fb0cab0ac2

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

module Frank
  module Rescue
    
    def render_404
      template = File.expand_path(File.dirname(__FILE__)) + '/templates/404.haml'
      locals = { :request => @env, :dynamic_folder => @dynamic_folder }

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

      @response['Content-Type'] = 'text/html'
      @response.status = 500
      @response.body = Tilt.new(template, 1).render(Object.new, locals = locals)   
      log_request('500', excp)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
frank-0.2.0 lib/frank/rescue.rb