nix-amer/internal/buildfile/errors.go

18 lines
322 B
Go
Raw Normal View History

package buildfile
import (
"fmt"
2018-11-13 12:10:55 +00:00
"github.com/xdrm-brackets/nix-amer/internal/clifmt"
)
2018-11-11 18:01:00 +00:00
// LineError wraps errors with a line index
type LineError struct {
Line int
Err error
}
2018-11-11 18:01:00 +00:00
// Error implements Error
func (le LineError) Error() string {
return fmt.Sprintf(":%d %s", le.Line, clifmt.Color(31, le.Err.Error()))
}