diff --git a/lib/params/base_validator.rb b/lib/params/base_validator.rb index c394519aa..4c2571e84 100644 --- a/lib/params/base_validator.rb +++ b/lib/params/base_validator.rb @@ -72,7 +72,11 @@ def email_format(params, key, message: nil) return if params[key].blank? return if params[key].to_s.strip.split(/\s*[;,]\s*/).all? { |email| email.match?(EMAIL_REGEXP) } - raise_error(message || "#{key} must follow the email format") + if Rails.env.production? + Rollbar.error(message || "#{key} must follow the email format") if defined?(Rollbar) + else + raise_error(message || "#{key} must follow the email format") + end end def unique_value(params, key, message: nil)