lib/lita.rb in lita-4.0.2 vs lib/lita.rb in lita-4.0.3

- old
+ new

@@ -50,15 +50,19 @@ redis = Redis.new(config.redis) Redis::Namespace.new(REDIS_NAMESPACE, redis: redis).tap do |client| begin client.ping rescue Redis::BaseError => e - Lita.logger.fatal I18n.t( - "lita.redis.exception", - message: e.message, - backtrace: e.backtrace.join("\n") - ) - abort + if Lita.test_mode? + raise RedisError, I18n.t("lita.redis.test_mode_exception", message: e.message) + else + Lita.logger.fatal I18n.t( + "lita.redis.exception", + message: e.message, + backtrace: e.backtrace.join("\n") + ) + abort + end end end end end