code: public RuntimeException traceError( Object value, RuntimeException cause ) {
          getLogger().log( Level.SEVERE, "Error during serialization", cause );
          if ( wrapExceptions ) {
              return new JsonSerializationException( cause );
          } else {
              return cause;
          }
      }
docs: Trace an error and returns a corresponding exception.
  
  @param value current value
  @param cause cause of the error
  
  @return a {@link JsonSerializationException} if we wrap the exceptions, the cause otherwise