Package: ruby-sinatra
Version: 1.3.2-1
Severity: normal

Dear Maintainer,
When error logging in sinatra fails (with exception), it can't process
exception in right way.

Example:
Our code handles Errno:EROFS:
error Errno:EROFS do
  #some processing
end

If standard logger (rack.error) starts failing (e.g. filesystem become
read only), our handlers stop working and default error page appears.
For fix this problem, Sinatra should ignore exceptions

Fixing patch could be found in attachment

-- 
Thanks,
Aliaksandr Barouski
diff -Naur sinatra-1.3.2-orig/lib/sinatra/base.rb sinatra-1.3.2/lib/sinatra/base.rb
--- sinatra-1.3.2-orig/lib/sinatra/base.rb	2012-08-06 13:15:29.599949551 +0300
+++ sinatra-1.3.2/lib/sinatra/base.rb	2012-08-06 13:02:45.000000000 +0300
@@ -927,6 +927,8 @@
     def dump_errors!(boom)
       msg = ["#{boom.class} - #{boom.message}:", *boom.backtrace].join("\n\t")
       @env['rack.errors'].puts(msg)
+    rescue ::Exception => boom
+      # Just ignore it
     end
 
     class << self
_______________________________________________
Pkg-ruby-extras-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers

Reply via email to