2018-11-07 21:13:47 +00:00
|
|
|
package buildfile
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-11-18 21:49:11 +00:00
|
|
|
"git.xdrm.io/go/nix-amer/internal/clifmt"
|
2018-11-07 21:13:47 +00:00
|
|
|
)
|
|
|
|
|
2018-11-11 18:01:00 +00:00
|
|
|
// LineError wraps errors with a line index
|
2018-11-07 21:13:47 +00:00
|
|
|
type LineError struct {
|
|
|
|
Line int
|
|
|
|
Err error
|
|
|
|
}
|
|
|
|
|
2018-11-11 18:01:00 +00:00
|
|
|
// Error implements Error
|
2018-11-07 21:13:47 +00:00
|
|
|
func (le LineError) Error() string {
|
2018-11-10 11:37:31 +00:00
|
|
|
return fmt.Sprintf(":%d %s", le.Line, clifmt.Color(31, le.Err.Error()))
|
2018-11-07 21:13:47 +00:00
|
|
|
}
|