Skip to main content

analyze_error_chain

Function analyze_error_chain 

Source
pub(crate) fn analyze_error_chain(error: &Error) -> String
Expand description

Analyze the error chain of a reqwest error and return a concise, actionable message.

This traverses the error chain to extract specific failure details and provides user-friendly explanations with actionable suggestions when possible.

The advantage of this approach is that we can be way more specific about the errors which can occur, rather than just returning a generic error message. The downside is that we have to maintain this code as reqwest and hyper evolve. However, this is a trade-off we are willing to make for better user experience.