2018-11-18 18:08:18 +00:00
|
|
|
package bash
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-11-18 21:49:11 +00:00
|
|
|
"git.xdrm.io/go/nix-amer/internal/clifmt"
|
2018-11-18 18:08:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ErrNullReceiver is raised when a null receiver is provided
|
|
|
|
var ErrNullReceiver = fmt.Errorf("receiver must not be null")
|
|
|
|
|
|
|
|
// ErrInvalidReceiver is raised when an invalid receiver is provided
|
|
|
|
var ErrInvalidReceiver = fmt.Errorf("receiver must be compatible with *File")
|
|
|
|
|
|
|
|
// LineError wraps errors with a line index
|
|
|
|
type LineError struct {
|
|
|
|
Line int
|
|
|
|
Err error
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error implements Error
|
|
|
|
func (le LineError) Error() string {
|
|
|
|
return fmt.Sprintf(":%d %s", le.Line, clifmt.Color(31, le.Err.Error()))
|
|
|
|
}
|