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