dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.94k stars 482 forks source link

Display more friendly error message for common health checks errors #6279

Open JamesNK opened 1 month ago

JamesNK commented 1 month ago

Is there an existing issue for this?

Describe the bug

This is what is displayed for a health check that is validates whether an endpoint returns 200:

Image

No message is returned so health checks defaults to displaying the exception message. This doesn't look user friendly.

The health check should have a failure message like "Request to xxx timed out" if there is a timeout. Or "Request to xxx returned yyy status code".

We should do the same for other built-in checks: polling an endpoint for 200, a database for a good response, or message queue, etc. The failure message message should explain what has gone wrong in a friendly way. More detail from the exception message is still available from the exception details if the user wants to view it.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

davidfowl commented 1 month ago

Maybe we should do this here. That way we don't need to do anything special for these health checks.