mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-07-03 17:22:33 +00:00
Improve panic messages
This commit is contained in:
@@ -46,11 +46,11 @@ func (d *Database) IndexEnsure(cfg interface{}, document interface{}) (err error
|
|||||||
|
|
||||||
tpl, err = template.New("").Parse(indexTag)
|
tpl, err = template.New("").Parse(indexTag)
|
||||||
if err != nil {
|
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)
|
err = tpl.Execute(tmpBuffer, cfg)
|
||||||
if err != nil {
|
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()
|
indexString := tmpBuffer.String()
|
||||||
|
|||||||
Reference in New Issue
Block a user