goldsmith/error.go

19 lines
266 B
Go
Raw Normal View History

2018-12-08 19:18:51 +00:00
package goldsmith
import "fmt"
type Error struct {
Name string
Path string
Err error
}
2018-12-10 01:00:46 +00:00
func (err Error) Error() string {
2018-12-08 19:18:51 +00:00
var path string
2018-12-10 01:00:46 +00:00
if len(err.Path) > 0 {
path = "@" + err.Path
2018-12-08 19:18:51 +00:00
}
2018-12-10 01:00:46 +00:00
return fmt.Sprintf("[%s%s]: %s", err.Name, path, err.Err.Error())
2018-12-08 19:18:51 +00:00
}