From: Dimitri Aivaliotis Date: 2005-01-07T01:04:11+09:00 Subject: Re: What's missing? (was Re: Best ways to accelerate Ruby's popularity) On Fri, 7 Jan 2005 00:08:53 +0900, Douglas Livingstone wrote: > Browser-friendly error messages would be *very* helpful; knowing what > is wrong would be easier to work with than just getting a 500 error. > Try this: ---- begin 500.rbx---- r = Apache.request rp = r.prev r.content_type = 'text/plain' r.send_http_header puts "Something unexpected happened. Please report the following to the site administrator.\n" if !rp.nil? puts rp.connection.remote_ip puts 'uri: ' + rp.uri puts ENV.inspect puts rp.error_message.to_s puts rp.headers_in.to_a.inspect end ----end 500.rbx---- I've been using that for awhile (forgot where I first saw it...). Set up 500.rbx as an ErrorDocument in Apache: ErrorDocument 500 /path/from/document/root/to/500.rbx and make sure that mod_ruby handles your *.rbx files: SetHandler ruby-object RubyHandler Apache::RubyRun.instance HTH, - Dimitri