@@ -324,13 +324,13 @@ static DataComponentPatch patchOrEmptyOf(@Nullable DynamicOps<Tag> ops, Object o
324324
325325 static DataComponentMap mapOf (Context cx , Object from ) {
326326 return tryMapOf (cx , from )
327- .getOrThrow (error -> new KubeRuntimeException ("Failed to warp DataComponentMap: %s" .formatted (error ))
327+ .getOrThrow (error -> new KubeRuntimeException ("Failed to wrap DataComponentMap: %s" .formatted (error ))
328328 .source (SourceLine .of (cx )));
329329 }
330330
331331 static DataComponentPatch patchOf (Context cx , Object from ) {
332332 return tryPatchOf (cx , from )
333- .getOrThrow (error -> new KubeRuntimeException ("Failed to warp DataComponentMap : %s" .formatted (error ))
333+ .getOrThrow (error -> new KubeRuntimeException ("Failed to wrap DataComponentPatch : %s" .formatted (error ))
334334 .source (SourceLine .of (cx )));
335335 }
336336
@@ -379,7 +379,7 @@ static DataResult<DataComponentMap> tryMapOf(Context cx, @Nullable Object o) {
379379 }
380380 } catch (EvaluatorException e ) {
381381 failed = true ;
382- errors .add (Pair .of (type , "Failed to parse data component from input '%s' : %s" .formatted (value , e )));
382+ errors .add (Pair .of (type , "Failed to parse input as data component : %s" .formatted (e . details () )));
383383 continue ;
384384 }
385385 }
@@ -410,9 +410,9 @@ static DataResult<DataComponentMap> tryMapOf(Context cx, @Nullable Object o) {
410410
411411 var id = reg .access ().registryOrThrow (Registries .DATA_COMPONENT_TYPE ).getKeyOrNull (type );
412412
413- return "'%s': %s" .formatted (id , error );
413+ return "'%s' -> %s" .formatted (id , error );
414414 }).collect (Collectors .joining ("; " ));
415- yield error (() -> "Failed to parse DataComponentMap: " + msg , builder .build ());
415+ yield error (() -> "Invalid component map format, errored input: [%s]" . formatted ( msg ) , builder .build ());
416416 } else {
417417 yield success (builder .build ());
418418 }
@@ -422,7 +422,7 @@ static DataResult<DataComponentMap> tryMapOf(Context cx, @Nullable Object o) {
422422 try {
423423 yield success (readMap (reg .nbt (), new StringReader (s )));
424424 } catch (CommandSyntaxException ex ) {
425- yield error (() -> "Error parsing DataComponentMap from %s : %s" .formatted (s , ex .getMessage ()));
425+ yield error (() -> "Invalid string format '%s' for DataComponentMap : %s" .formatted (s , ex .getMessage ()));
426426 }
427427 }
428428 default -> error (() -> "Don't know how to convert %s to DataComponentMap!" .formatted (o ));
@@ -466,7 +466,7 @@ static DataResult<DataComponentPatch> tryPatchOf(Context cx, @Nullable Object o)
466466 }
467467 } catch (EvaluatorException e ) {
468468 failed = true ;
469- errors .add (Pair .of (type , "Failed to parse data component from input '%s' : %s" .formatted (value , e )));
469+ errors .add (Pair .of (type , "Failed to parse input as data component : %s" .formatted (e . details () )));
470470 continue ;
471471 }
472472 }
@@ -497,9 +497,9 @@ static DataResult<DataComponentPatch> tryPatchOf(Context cx, @Nullable Object o)
497497
498498 var id = reg .access ().registryOrThrow (Registries .DATA_COMPONENT_TYPE ).getKeyOrNull (type );
499499
500- return "'%s': %s" .formatted (id , error );
500+ return "'%s' -> %s" .formatted (id , error );
501501 }).collect (Collectors .joining ("; " ));
502- yield error (() -> "Failed to parse DataComponentPatch: " + msg , builder .build ());
502+ yield error (() -> "Invalid component map format, errored input: [%s]" . formatted ( msg ) , builder .build ());
503503 } else {
504504 yield success (builder .build ());
505505 }
@@ -509,7 +509,7 @@ static DataResult<DataComponentPatch> tryPatchOf(Context cx, @Nullable Object o)
509509 try {
510510 yield success (readPatch (reg .nbt (), new StringReader (s )));
511511 } catch (CommandSyntaxException ex ) {
512- yield error (() -> "Error parsing DataComponentPatch from %s : %s" .formatted (s , ex .getMessage ()));
512+ yield error (() -> "Invalid string format '%s' for DataComponentPatch : %s" .formatted (s , ex .getMessage ()));
513513 }
514514 }
515515 default -> error (() -> "Don't know how to convert %s to DataComponentPatch!" .formatted (o ));
0 commit comments