exception -> exit(2). unimplemented -> message+exit(1)

This commit is contained in:
Denis Knauf 2013-04-15 12:13:23 +02:00
parent d7edbb750e
commit 960f3ef7a9

View file

@ -138,7 +138,8 @@ class RobustServer
begin begin
self.run self.run
rescue UnimplementedRun rescue UnimplementedRun
raise output.puts $!.message
exit 1
rescue SystemExit rescue SystemExit
output.puts "Server interrupted by signal: #$!" output.puts "Server interrupted by signal: #$!"
raise raise
@ -149,6 +150,7 @@ class RobustServer
output.puts [:rescue, $!, $!.class, $!.backtrace].inspect output.puts [:rescue, $!, $!.class, $!.backtrace].inspect
retry if retries.retry? retry if retries.retry?
output.print "Too many errors in too short time. Give up: " output.print "Too many errors in too short time. Give up: "
exit 2
end end
ensure ensure
output.puts "Disregarded signals: #{@signals.map(&Signal.method(:[])).join( ', ')}" output.puts "Disregarded signals: #{@signals.map(&Signal.method(:[])).join( ', ')}"