Skip to content

Commit

Permalink
feat: replace error with custom error
Browse files Browse the repository at this point in the history
  • Loading branch information
d-strobel committed Nov 13, 2023
1 parent 4798e03 commit a26778e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parser/xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"encoding/xml"
"fmt"
"strings"

"github.com/d-strobel/gowindows/winerror"
)

type psString string
Expand Down Expand Up @@ -53,7 +55,7 @@ func DecodeCLIXML(xmlDoc string) (string, error) {

err := xml.Unmarshal([]byte(xmlDoc), &v)
if err != nil {
return "", fmt.Errorf("while unmarshalling CLIXML document: %s", err)
return "", winerror.Errorf(winerror.ParserError, "DecodeCLIXML: Failed to unmarshal xml document: %s", err)
}

xmlDoc = strings.TrimSpace(v.String())
Expand Down

0 comments on commit a26778e

Please sign in to comment.