@@ -509,6 +509,7 @@ private void writeToBucket(String path, Object value, RedisData sink) {
509509}
510510
511511if (customConversions .hasCustomWriteTarget (value .getClass ())) {
512+
512513Class <?> targetType = customConversions .getCustomWriteTarget (value .getClass ());
513514
514515if (ClassUtils .isAssignable (Map .class , targetType )) {
@@ -521,9 +522,9 @@ private void writeToBucket(String path, Object value, RedisData sink) {
521522} else if (ClassUtils .isAssignable (byte [].class , targetType )) {
522523sink .getBucket ().put (path , toBytes (value ));
523524} else {
524- throw new IllegalArgumentException ("converter must not fool me!!" );
525+ throw new IllegalArgumentException (
526+ String .format ("Cannot convert value '%s' of type %s to bytes." , value , value .getClass ()));
525527}
526-
527528}
528529
529530}
@@ -634,7 +635,8 @@ private void writeMap(String keyspace, String path, Class<?> mapValueType, Map<?
634635
635636Matcher matcher = pattern .matcher (entry .getKey ());
636637if (!matcher .find ()) {
637- throw new RuntimeException ("baähhh" );
638+ throw new IllegalArgumentException (
639+ String .format ("Cannot extract map value for key '%s' in path '%s'." , entry .getKey (), path ));
638640}
639641String key = matcher .group (2 );
640642target .put (key , fromBytes (entry .getValue (), valueType ));
@@ -665,7 +667,8 @@ private void writeMap(String keyspace, String path, Class<?> mapValueType, Map<?
665667
666668Matcher matcher = pattern .matcher (key );
667669if (!matcher .find ()) {
668- throw new RuntimeException ("baähhh" );
670+ throw new IllegalArgumentException (
671+ String .format ("Cannot extract map value for key '%s' in path '%s'." , key , path ));
669672}
670673String mapKey = matcher .group (2 );
671674
0 commit comments