Project

General

Profile

« Previous | Next » 

Revision 824a3af6

Added by Marc Dequènes almost 12 years ago

[fix] use sprintf-like operator and count upon stringification instead of bare concatenation

View differences:

bin/postman
# it also tests search parameters (provided to setup_connection)
ActiveLdap::Base.find(:first)
rescue
logger.fatal "LDAP failure: " + $!
logger.fatal "LDAP failure: %s" % $!
exit 1
end
......
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")
logger.error "Mail processing crashed unexpectedly: %s" % $!
logger.error "Crash class: %s" % $!.class.to_s
logger.error "Crash trace: %s" % $!.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")
logger.error "IMAP processing crashed unexpectedly: %s" % $!
logger.error "Crash class: %s" % $!.class.to_s
logger.error "Crash trace: %s" % $!.backtrace.join("\n")
end
logger.info "Bot terminating"
end
lib/cyborghood/base/config.rb
filepath = File.join(File.expand_path(CFG_DIR), filename)
File.read(filepath)
rescue
logger.fatal "Problems fetching configuration file '" + filepath + "': " + $!
logger.fatal "Problems fetching configuration file '%s': %s" % [filepath, $!]
exit 1
end
end
lib/cyborghood/command_runner.rb
rescue CyberError => e
result.message = tm_(e.message.capitalize + ".")
rescue
logger.error "Command crashed: " + $!
logger.error "Crash trace: " + $!.backtrace.join("\n")
logger.error "Command crashed: %s" % $!
logger.error "Crash trace: %s" % $!.backtrace.join("\n")
result.message = _("Internal error. Administrator is warned.")
end

Also available in: Unified diff