tiaguinho / gosoap

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

Addresses issue - [Differentiate fault and response unmarshal error] #64

Closed AjithPanneerselvam closed 4 years ago

AjithPanneerselvam commented 4 years ago

Issue link: https://github.com/tiaguinho/gosoap/issues/63

What does this PR offer?

Now, we can differentiate the fault error from other errors we get from *Response.Unmarshal(). The sample code is given below.

        var sampleResponse SampleResponse
    err = response.Unmarshal(&sampleResponse)
    if err != nil {
        if gosoap.IsFault(err) {
            return "", errors.Wrap(err, "error as fault occurred")  // Or, do something instead of returning err
        }

        return "", errors.Wrap(err, "error unmarshalling sample response")
    }

All the unit tests passed.

codecov-commenter commented 4 years ago

Codecov Report

Merging #64 into master will decrease coverage by 0.29%. The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
- Coverage   74.42%   74.13%   -0.30%     
==========================================
  Files           5        5              
  Lines         305      317      +12     
==========================================
+ Hits          227      235       +8     
- Misses         63       67       +4     
  Partials       15       15              
Impacted Files Coverage Δ
response.go 55.55% <57.14%> (+5.55%) :arrow_up:
wsdl.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9ad5306...fefe68c. Read the comment docs.

AjithPanneerselvam commented 4 years ago

@tiaguinho Please review the PR.