Unify error messages

This commit is contained in:
2024-10-18 19:04:08 +02:00
parent 411cd89b7c
commit d4e7bce5e2
20 changed files with 92 additions and 110 deletions

View File

@@ -1,9 +1,6 @@
package atom
import (
"errors"
"fmt"
)
import "fmt"
type XHTMLText struct {
*CommonAttributes
@@ -18,7 +15,7 @@ func (x *XHTMLText) isText() bool { return true }
// error.
func (x *XHTMLText) Check() error {
if x.Type != "xhtml" {
return errors.New("type attribute of xhtml text must be xhtml")
return fmt.Errorf("type attribute of xhtml text %v must be xhtml", x)
}
if err := x.XHTMLDiv.Check(); err != nil {