tiaguinho / gosoap

🦉SOAP package for Go
MIT License
507 stars 176 forks source link

Differentiate fault and response unmarshal error #63

Closed AjithPanneerselvam closed 4 years ago

AjithPanneerselvam commented 4 years ago

In the current implementation, the response unmarhsal error is not differentiating the fault error and the response unmarshal error. Both errors are technically different. The client should be able to differentiate both the error to take action based on the type of the error.

Unmarhsal error:

expected element type <IngetResponse> but have <IngestResponse>

Fault error:

[soap:Server]: Qube.Mama.SoapException: The remote server returned an error: (550) File unavailable (e.g., file not found, no access).
The remote server returned an error: (550) File unavailable (e.g., file not found, no access).

Code Reference: https://github.com/tiaguinho/gosoap/blob/master/response.go#L16