Unify error messages
This commit is contained in:
@@ -2,7 +2,6 @@ package atom
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -43,11 +42,11 @@ func (i *InlineXHTMLContent) getType() string { return i.Type }
|
||||
// returns an error.
|
||||
func (i *InlineXHTMLContent) Check() error {
|
||||
if i.Type != "xhtml" {
|
||||
return errors.New("type attribute of inline xhtml content must be xhtml")
|
||||
return fmt.Errorf("type attribute of inline xhtml content %v must be xhtml", i)
|
||||
}
|
||||
|
||||
if err := i.XHTMLDiv.Check(); err != nil {
|
||||
return fmt.Errorf("xhtml div element %v of inline xhtml content %v: %v", i.XHTMLDiv, i, err)
|
||||
return fmt.Errorf("xhtml div element of inline xhtml content %v: %v", i, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user