Empty Exception Body
See original GitHub issueI am going to test bad request (400) with a customized error message. The test gets 400 as status code; however the content body is empty.
[HttpPost]
public override async Task<IActionResult> PostAsync([FromBody] Contract.User entity)
{
if (entity == null)
{
return Error(new Error() { Status = "400", Title = "Invalid request body", Detail = "The provided request
entity body is not valid." });
}
return await base.PostAsync(entity);
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Spring boot Rest responding with empty body for ...
But when I add my @ControllerAdvice, Spring doesn't response with generic error body. The body is empty with correct response headers
Read more >Empty request JSON body throws exception in a ...
When attempting to parse a JSON body, which is empty, an exception seems to happen. Environment. msw: 0.16.2. Expected behavior. Empty body is ......
Read more >Spring boot Rest responding with empty body for exceptions ...
But it broke all other exceptions handled by ResponseEntityExceptionHandler , and returned empty response body for them. But the fix is easy, just...
Read more >[regression] Empty response body when user is an ...
Empty response body when user has 'access site reports' permission and an exception is thrown; trace cannot be encoded because of recursion ...
Read more >Is it ever ok to have an empty catch statement?
I do it all the time with things like conversion errors in D: import std.conv, std.stdio, std.exception; void main(string[] args) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks.
@OKTAYKIR thanks for taking the time to report and reproduce this issue. It should be resolved in v2.1.1.
If you’re still having trouble please reopen this issue. For your reference, see #145 for the fix.
Thanks