aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-01-05 13:49:17 +0100
committerDmitry Vyukov <dvyukov@google.com>2022-01-11 16:30:08 +0100
commita19c1bce2eee5a1893b4ae9c8292b0f1b2630225 (patch)
tree9d682650617942c7318f64878736b8fbab4a1eb0
parent576c26a1524fc962de6cae781bf9ea5aebeaf7a3 (diff)
prog: make panic message more useful
Output actual resource type we tried to create in the panic messages. In some cases we spoof it and it's not the original resource type.
-rw-r--r--prog/rand.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/prog/rand.go b/prog/rand.go
index 7a7de9b4a..aea2daeb1 100644
--- a/prog/rand.go
+++ b/prog/rand.go
@@ -417,8 +417,8 @@ func (r *randGen) createResource(s *state, res *ResourceType, dir Dir) (arg Arg,
for _, meta := range metas {
ctors = append(ctors, meta.Name)
}
- panic(fmt.Sprintf("failed to create a resource %v with %v",
- res.Desc.Kind[0], strings.Join(ctors, ", ")))
+ panic(fmt.Sprintf("failed to create a resource %v (%v) with %v",
+ kind, res.Desc.Kind[0], strings.Join(ctors, ", ")))
}
func (r *randGen) generateText(kind TextKind) []byte {