예제 #1
0
파일: eval.go 프로젝트: earneet/elvish
// errorf stops the ec.eval immediately by panicking with a diagnostic message.
// The panic is supposed to be caught by ec.eval.
func (ec *evalCtx) errorf(p parse.Pos, format string, args ...interface{}) {
	errutil.Throw(errutil.NewContextualError(
		fmt.Sprintf("%s (%s)", ec.name, ec.context), "evalling error",
		ec.text, int(p), format, args...))
}
예제 #2
0
파일: module.go 프로젝트: wanlanjian/elvish
func throw(e error) {
	errutil.Throw(e)
}
예제 #3
0
파일: compile.go 프로젝트: wlihome/elvish
func (cc *compileCtx) errorf(p parse.Pos, format string, args ...interface{}) {
	errutil.Throw(errutil.NewContextualError(cc.name, "static error", cc.text, int(p), format, args...))
}
예제 #4
0
func (rd *Reader) badEscSeq(msg string) {
	errutil.Throw(newBadEscSeq(rd.currentSeq, msg))
}
예제 #5
0
파일: parse.go 프로젝트: wlihome/elvish
// errorf formats the error and terminates processing.
func (p *Parser) errorf(pos int, format string, args ...interface{}) {
	p.Root = nil
	errutil.Throw(errutil.NewContextualError(p.Name, "parsing error", p.text, pos, format, args...))
}