mirror of
https://github.com/danog/liquid.git
synced 2024-11-30 07:18:58 +01:00
Rename renderError -> render.Error
This commit is contained in:
parent
1da9d4072e
commit
315af1a51a
@ -73,7 +73,9 @@ func IsTemplateError(err error) bool {
|
||||
return true
|
||||
case render.ParseError:
|
||||
return true
|
||||
case render.Error:
|
||||
return true
|
||||
default:
|
||||
return render.IsRenderError(err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -9,24 +9,14 @@ import (
|
||||
"github.com/osteele/liquid/evaluator"
|
||||
)
|
||||
|
||||
// A RenderError is an evaluation error during template rendering.
|
||||
type renderError string
|
||||
// An Error is an evaluation error during template rendering.
|
||||
type Error string
|
||||
|
||||
func (e renderError) Error() string { return string(e) }
|
||||
func (e Error) Error() string { return string(e) }
|
||||
|
||||
// Errorf creates a render error.
|
||||
func Errorf(format string, a ...interface{}) renderError {
|
||||
return renderError(fmt.Sprintf(format, a...))
|
||||
}
|
||||
|
||||
// IsRenderError returns a bool whether the error is a render error.
|
||||
func IsRenderError(err error) bool {
|
||||
switch err.(type) {
|
||||
case renderError:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
func Errorf(format string, a ...interface{}) Error {
|
||||
return Error(fmt.Sprintf(format, a...))
|
||||
}
|
||||
|
||||
// Render renders the AST rooted at node to the writer.
|
||||
|
Loading…
Reference in New Issue
Block a user