Commit 6d1a3bb
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) <noreply@anthropic.com>
Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>1 parent 67e01b2 commit 6d1a3bb
1 file changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
621 | 624 | | |
622 | | - | |
| 625 | + | |
623 | 626 | | |
624 | | - | |
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
628 | 630 | | |
629 | 631 | | |
630 | | - | |
631 | | - | |
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
638 | 637 | | |
639 | 638 | | |
640 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
641 | 648 | | |
642 | 649 | | |
643 | | - | |
644 | 650 | | |
645 | 651 | | |
646 | 652 | | |
| |||
0 commit comments