Made wrapped error accessible

This commit is contained in:
Magnus Åhall 2023-09-26 09:33:46 +02:00
parent 35249137c5
commit ebf3a9aa38

6
pkg.go
View File

@ -9,7 +9,7 @@ import (
)
type Error struct {
err error
Wrapped error
File string
Line int
Data interface{}
@ -47,7 +47,7 @@ func (wrapped Error) Error() string {
"[%s:%d] %s",
wrapped.File,
wrapped.Line,
wrapped.err.Error(),
wrapped.Wrapped.Error(),
)
}
@ -56,7 +56,7 @@ func create(err error, data interface{}) error {
file = file[baseDirLength+1:]
wrapped := Error{
err: err,
Wrapped: err,
File: file,
Line: line,
Data: data,