Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jul 6, 2020

Conversation

AjithPanneerselvam
Copy link
Contributor

@AjithPanneerselvam AjithPanneerselvam commented Jul 6, 2020

Issue link: #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.

@AjithPanneerselvam AjithPanneerselvam changed the title Addresses issue [Differentiate fault and response unmarshal error] - https://github.com/tiaguinho/gosoap/issues/63 Addresses issue - [Differentiate fault and response unmarshal error] Jul 6, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jul 6, 2020

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%) ⬆️
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
Copy link
Contributor Author

AjithPanneerselvam commented Jul 6, 2020

@tiaguinho Please review the PR.

@tiaguinho tiaguinho merged commit c64bd2e into tiaguinho:master Jul 6, 2020
@AjithPanneerselvam AjithPanneerselvam deleted the enhance/unmarhsal-error branch July 6, 2020 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants