code: @SuppressWarnings("unchecked")
  	private Map<String, Object> safeSerialize(ObjectMapper mapper, Object bean,
  			String prefix) {
  		try {
  			return new HashMap<>(mapper.convertValue(bean, Map.class));
  		}
  		catch (Exception ex) {
  			return new HashMap<>(Collections.singletonMap("error",
  					"Cannot serialize '" + prefix + "'"));
  		}
  	}
docs: Cautiously serialize the bean to a map (returning a map with an error message
  instead of throwing an exception if there is a problem).
  @param mapper the object mapper
  @param bean the source bean
  @param prefix the prefix
  @return the serialized instance