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

Proxy mode: Unhandled exception when target is not working #467

Closed
LevYas opened this issue May 17, 2020 · 7 comments
Closed

Proxy mode: Unhandled exception when target is not working #467

LevYas opened this issue May 17, 2020 · 7 comments
Labels

Comments

@LevYas
Copy link

LevYas commented May 17, 2020

WireMock returns stack trace instead of a meaningful message, it is very misleading.
Repro: https://github.com/LevYas/WireMockNetRepro
2020-05-17 17_08_29-WireMockRepro (Debugging) - Microsoft Visual Studio

It would be very nice to return a message, saying that the target is not available.

@StefH StefH added the bug label May 17, 2020
@StefH
Copy link
Collaborator

StefH commented May 18, 2020

Preview version WireMock.Net.1.2.10-ci-13352 on MyGet should fix this 500 error, please test.

@LevYas
Copy link
Author

LevYas commented May 18, 2020

Tested. For me, it doesn't return "No such host is known.", but "No connection could be made because the target machine actively refused it.":

< HTTP/1.1 100 Continue
< HTTP/1.1 500 Internal Server Error
...
* HTTP error before end of send, stop sending
<
{"Status":"No connection could be made because the target machine actively refused it."}* Closing connection 0

Anyway, it's much better than a stack trace :D
But I think the test in your PR might not be stable.

@StefH
Copy link
Collaborator

StefH commented May 18, 2020

I run the tests for netcore 3.1 and I noticed a difference there, so I just check on known.

@LevYas
Copy link
Author

LevYas commented May 18, 2020

I also used netcore 3.1, but on Windows, maybe that's the reason

@StefH
Copy link
Collaborator

StefH commented May 18, 2020

OK, the difference is that I try to connect to a non-existing hostname.
And you try to connect to localhost (which exists) but nothing listens at port 5000.

@LevYas
Copy link
Author

LevYas commented May 18, 2020

Ah, sure, you are right, thanks.

@StefH
Copy link
Collaborator

StefH commented May 18, 2020

I'll merge to master. New NuGet will be released soon.

@StefH StefH closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants