Skip to content

Commit 3129e96

Browse files
authored
fix(serializer): provide more information when association can't be loaded (#704)
1 parent 32b6206 commit 3129e96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/serializers/forest_liana/serializer_factory.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def relationship_related_link(attribute_name)
127127
ret[:href] = "/forest/#{ForestLiana.name_for(object.class)}/#{object.id}/relationships/#{attribute_name}"
128128
end
129129
end
130-
rescue TypeError, ActiveRecord::StatementInvalid, NoMethodError
131-
puts "Cannot load the association #{attribute_name} on #{object.class.name} #{object.id}."
130+
rescue TypeError, ActiveRecord::StatementInvalid, NoMethodError => exception
131+
FOREST_LOGGER.warn "Cannot load the association #{attribute_name} on #{object.class.name} #{object.id}.\n#{exception&.backtrace&.join("\n\t")}"
132132
end
133133
end
134134

0 commit comments

Comments
 (0)