Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Parser errors ErrEmptyBrackets = "bracket statement must contain an expression '{{ <expression> }}'" ErrWrongNextToken = "expected next token to be '%s', got '%s' instead" ErrExpectedExpression = "expected expression, got '}}'" ErrCouldNotParseAs = "could not parse '%s' as '%s'" ErrNoPrefixParseFunc = "no prefix parse function for '%s'" ErrIllegalToken = "illegal token '%s' found" ErrElseifCannotFollowElse = "'@elseif' directive cannot follow '@else'" ErrInsertStmtNotDefined = "the insert statement named '%s' is not defined" ErrExpectedIdentifier = "expected identifier, got '%s' instead" ErrExceptedComponentStmt = "expected *ComponentStmt, got %T" ErrComponentMustHaveBlock = "the component '%s' must have a block" ErrExpectedObjectLiteral = "expected object literal, got '%s' instead" // Evaluator (interpreter) errors ErrUnknownNodeType = "unknown node type '%T'" ErrInsertMustHaveContent = "the INSERT statement must have a content or a text argument" ErrIdentifierNotFound = "identifier '%s' not found" ErrIndexNotSupported = "the index operator '%s' is not supported" ErrUnknownOperator = "unknown operator '%s%s'" ErrTypeMismatch = "type mismatch '%s %s %s'" ErrUnknownTypeForOperator = "unknown type '%s' for '%s' operator" ErrPrefixOperatorIsWrong = "prefix operator '%s' cannot be applied to '%s'" ErrUseStmtMustHaveProgram = "the 'use' statement must have a program attached" ErrNoFuncForThisType = "function '%s' doesn't exist for type '%s'" ErrLoopVariableIsReserved = "the 'loop' variable is reserved. You cannot use it as a variable name" ErrVariableTypeMismatch = "cannot assign variable '%s' of type '%s' to type '%s'" ErrDotOperatorNotSupported = "the dot operator is not supported for type '%s'" ErrPropertyNotFound = "property '%s' not found in type '%s'" // Template errors ErrUnsupportedType = "unsupported type '%T'" ErrTemplateNotFound = "template not found" ErrUseStmtNotAllowed = "the 'use' statement is not allowed in a layout file. It will cause infinite recursion" NoErrorsFound = "there are no Textwire errors" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is the main error type for Textwire that contains all the necessary information about the error like the line number, file path, etc.
func (*Error) FatalOnError ¶
func (e *Error) FatalOnError()
FatalOnError calls log.Fatal if the error message is not empty
func (*Error) PanicOnError ¶
func (e *Error) PanicOnError()
PanicOnError panics if the error message is not empty
func (*Error) PrintOnError ¶
func (e *Error) PrintOnError()
PrintOnError prints the error message to the standard output when the error message is not empty
Click to show internal directories.
Click to hide internal directories.