Skip to content
Snippets Groups Projects
error.go 606 B
package engine

import (
	"fmt"
	"golang.org/x/net/html"
)

type UnsupportedTypeError struct {
	Message  string
	NodeType html.NodeType
}

func (e *UnsupportedTypeError) Error() string {
	return e.Message
}

type UnsupportedFunctionError struct {
	Message      string
	FunctionName string
}

func (e *UnsupportedFunctionError) Error() string {
	return fmt.Sprintf("%s: %s", e.Message, e.FunctionName)
}

type InvalidAttributeError struct {
	Message   string
	Attribute string
	Node      *html.Node
}

func (e *InvalidAttributeError) Error() string {
	return fmt.Sprintf("%s: %s", e.Message, e.Attribute)
}