Properly handle ErrorMessage

Some ECDK versions print ErrorMessage to the common EC log.
This commit is contained in:
Spotlight 2021-09-03 11:18:26 -05:00
parent 5bcb474a78
commit bd48515bf9
No known key found for this signature in database
GPG Key ID: 874AA355B3209BDC
2 changed files with 2 additions and 3 deletions

View File

@ -39,7 +39,7 @@ type Config struct {
SQLPass string `xml:"SQLPass"`
SQLDB string `xml:"SQLDB"`
Debug bool `xml:"Debug"`
Debug bool `xml:"Debug"`
NoAuth bool `xml:"NoAuth"`
}

View File

@ -206,8 +206,7 @@ func (e *Envelope) Error(errorCode int, reason string, err error) {
// Ensure all additional fields are empty to avoid conflict.
e.Body.Response.CustomFields = nil
e.AddKVNode("UserReason", reason)
e.AddKVNode("ServerReason", err.Error())
e.AddKVNode("ErrorMessage", fmt.Sprintf("%s: %v", reason, err))
}
// normalise parses a document, returning a document with only the request type's child nodes, stripped of prefix.