class Serega::DepthLimitError

Raised when fields nest deeper than config.depth_limit of the serializer that starts the serialization

UserSerializer.to_h(user, with: {friends: :friends})
# => Serega::DepthLimitError: Depth limit was exceeded

See Depth limit.