Project

General

Profile

« Previous | Next » 

Revision 2e179358

Added by Marc Dequènes about 13 years ago

  • ID 2e1793587b380bb4adf771158079169c8027ead1
  • Child 6b300a88

[debug] catch mail check crashes for debug purpose and stop gracefully

View differences:

bin/postman
def run
logger.info "Bot starting"
@imap.check_mails do |msg|
begin
process_message(msg)
rescue CyberError => e
raise
rescue
logger.error "Mail processing crashed: " + $!
logger.error "Crash trace: " + $!.backtrace.join("\n")
true
begin
@imap.check_mails do |msg|
begin
process_message(msg)
rescue CyberError => e
raise
rescue
logger.error "Mail processing crashed unexpectedly: " + $!
logger.error "Crash class: " + $!.class.to_s
logger.error "Crash trace: " + $!.backtrace.join("\n")
true
end
end
rescue
logger.error "IMAP processing crashed unexpectedly: " + $!
logger.error "Crash class: " + $!.class.to_s
logger.error "Crash trace: " + $!.backtrace.join("\n")
end
logger.info "Bot terminating"
end

Also available in: Unified diff