Skip to content

Commit 2e97e98

Browse files
committed
Improve error wrapping in runtime initialization with context
1 parent 552a656 commit 2e97e98

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

runtime/builtin.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package runtime
33
import (
44
"bytes"
55
"context"
6+
"fmt"
67
"io"
78

89
"github.com/MontFerret/contrib/modules/html"
@@ -31,12 +32,16 @@ func NewBuiltin(opts Options) (Runtime, error) {
3132
),
3233
)
3334

35+
if err != nil {
36+
return nil, fmt.Errorf("initialize html module: %w", err)
37+
}
38+
3439
engine, err := ferret.New(
3540
ferret.WithModules(htmlmod),
3641
)
3742

3843
if err != nil {
39-
return nil, err
44+
return nil, fmt.Errorf("initialize engine: %w", err)
4045
}
4146

4247
return &Builtin{

0 commit comments

Comments
 (0)