Closed Barsonax closed 1 month ago
Could I pick this up? I'm looking to contribute to open source projects that I use, so seems like an easy one to get started with?
@mithileshz Iam not a contributor to refit but it indeed seems like an easy change. Not sure though if the designers of refit had an explicit reason to drop the stacktrace though. I cant think of a valid reason of why this is desired behavior and if there is then it should atleast be configurable.
Not a maintainer but this seem like a good idea. I wonder why it was added. Is the try catch
block necessary? Nothing happens in the catch block.
Could I pick this up? I'm looking to contribute to open source projects that I use, so seems like an easy one to get started with?
@mithileshz Seems like a good starting PR, feel free to ask me questions if you get stuck:
InterfaceStubGenerator.Shared\InterfaceStubGenerator.cs
Verify.Support
for rider (can't remember how to do it in VS2022).If you'd like to make another change, try removing the unneeded whitespace after the constructor.
Yeah the try catch block seemed unnecessary to me too. Will create a PR later today.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Describe the bug š
When using integration tests with WebApplicationFactory it is handy to be able to see the full stack trace. Unfortunately refit's code gen generates this:
This causes the entire stack trace of the exception to be discarded:
When using the httpclient directly you get a much more detailed stacktrace:
If this code was generated the stack trace would be preserved:
See also https://learn.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions#capture-and-rethrow-exceptions-properly for best practices regarding exception rethrowing
Step to reproduce
Reproduction repository
https://github.com/Barsonax/CleanAspCoreWebApiTemplate/blob/main/CleanAspCore.Api.Tests/Endpoints/Departments/AddDepartmentsTests.cs
Expected behavior
The full stack trace should be available
Screenshots š¼ļø
No response
IDE
Rider Windows
Operating system
Windows
Version
No response
Device
No response
Refit Version
7.1.2
Additional information ā¹ļø
No response