Commit 0e8c50d
fix(crafter): surface auto-discovery errors instead of masking them
Fix variable shadowing in AddMaterialContactFreeWithAutoDetectedKind:
m, err := (loop-scoped) → m, err = (outer-scoped) so the error from
the last failed kind probe is propagated to the caller instead of
always being nil.
Also break early on protovalidate.ValidationError during auto-discovery
so schema-level failures (e.g. invalid material name) are surfaced
immediately instead of being masked by the kind-probing loop.
Fixes: #2394
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Vibhav Bobade <[email protected]>1 parent bb484cd commit 0e8c50d
1 file changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
649 | 652 | | |
650 | | - | |
| 653 | + | |
651 | 654 | | |
652 | | - | |
653 | 655 | | |
654 | 656 | | |
655 | 657 | | |
656 | 658 | | |
657 | 659 | | |
658 | | - | |
659 | | - | |
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | 665 | | |
667 | 666 | | |
668 | 667 | | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
669 | 676 | | |
670 | 677 | | |
671 | | - | |
672 | 678 | | |
673 | 679 | | |
674 | 680 | | |
| |||
0 commit comments