Skip to content

A platform for community discussion. Free, open, simple.

FIX: Avoid logging a warn for 404s.

Bianca Nenciu25453eb922f2
diff --git a/lib/json_error.rb b/lib/json_error.rb
index 5366c43c27e..9518eceeda4 100644
--- a/lib/json_error.rb
+++ b/lib/json_error.rb
@@ -32,6 +32,8 @@ module JsonError
return { errors: [message] } if message.present?
end
+ return { errors: [I18n.t('not_found')] } if obj.not_found
+
# Log a warning (unless obj is nil)
Rails.logger.warn("create_errors_json called with unrecognized type: #{obj.inspect}") if obj