diff --git a/parser/wtg/parse.go b/parser/wtg/parse.go index 359967b..d9693b6 100644 --- a/parser/wtg/parse.go +++ b/parser/wtg/parse.go @@ -1,6 +1,7 @@ package wtg import ( + "errors" "fmt" "image" "io" @@ -11,6 +12,8 @@ import ( svgmap "github.com/owulveryck/wardleyToGo/encoding/svg" ) +var ErrEmptyMap = errors.New("no map") + type Parser struct { visibilityOnly bool WMap *wardleyToGo.Map @@ -60,7 +63,7 @@ func (p *Parser) parse(s string) error { return fmt.Errorf("error in parsing: %w", err) } if len(inv.NodeInventory) == 0 { - return fmt.Errorf("no map") + return ErrEmptyMap } m, err := consolidateMap(inv.NodeInventory, inv.EdgeInventory) if err != nil {