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'" ErrExceptedReserveStmt = "Expected *ReserveStatement, got %T" ErrInsertStmtNotDefined = "The insert statement named '%s' is not defined" ErrExpectedIdentifier = "Expected identifier, 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" ErrFuncDoNotExist = "" /* 134-byte string literal not displayed */ 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'" // 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.