feat(actions): improve errors and logs (#340)

This commit is contained in:
Ludvig Lundgren 2022-07-07 16:28:14 +02:00 committed by GitHub
parent 31fbe013ff
commit 402596523d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 315 additions and 418 deletions

View file

@ -7,6 +7,7 @@ import (
"time"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/pkg/errors"
)
type Macro struct {
@ -65,13 +66,13 @@ func (m Macro) Parse(text string) (string, error) {
// setup template
tmpl, err := template.New("macro").Parse(text)
if err != nil {
return "", err
return "", errors.Wrap(err, "could parse macro template")
}
var tpl bytes.Buffer
err = tmpl.Execute(&tpl, m)
if err != nil {
return "", err
return "", errors.Wrap(err, "could not parse macro")
}
return tpl.String(), nil