It would be useful to understand which objects are causing the problem. Transforming to string a map does not seem very useful. It may be more reasonable to simply skip maps or unknown object types altogether.