From ee1b0e17d55e358a206790dd972e25f36dea4705 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Mon, 13 Jul 2020 02:44:32 +0200 Subject: [PATCH] Improve panic messages --- mongox/database/index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mongox/database/index.go b/mongox/database/index.go index 88f2ea4..e8c14f3 100644 --- a/mongox/database/index.go +++ b/mongox/database/index.go @@ -46,11 +46,11 @@ func (d *Database) IndexEnsure(cfg interface{}, document interface{}) (err error tpl, err = template.New("").Parse(indexTag) if err != nil { - panic(fmt.Errorf("invalid prop template, %v", indexTag)) + panic(fmt.Errorf("invalid prop template %v, err:%w", indexTag, err)) } err = tpl.Execute(tmpBuffer, cfg) if err != nil { - panic(fmt.Errorf("failed to evaluate prop template, %v", indexTag)) + panic(fmt.Errorf("failed to evaluate prop template %v, err:%w", indexTag, err)) } indexString := tmpBuffer.String()