Unify error messages
This commit is contained in:
5
logo.go
5
logo.go
@@ -2,7 +2,6 @@ package atom
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -25,10 +24,10 @@ func NewLogo(uri IRI) (*Logo, error) {
|
||||
// error.
|
||||
func (l *Logo) Check() error {
|
||||
if l.URI == "" {
|
||||
return errors.New("uri element of logo empty")
|
||||
return fmt.Errorf("uri element of logo %v empty", l)
|
||||
} else {
|
||||
if !isValidIRI(l.URI) {
|
||||
return fmt.Errorf("uri element %v of logo not correctly formatted", l.URI)
|
||||
return fmt.Errorf("uri element of logo %v not correctly formatted", l)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user