I have a binary that performs a healthcheck on another binary. (it checks if the timestamp is out of date. The other binary promises to periodically write a timestamp, and if the timestamp is ever out of date, something is wrong)
In my healthcheck binary, when this "something is wrong" case is encountered, should I:
If I understand your question correctly, I feel like conceptually returning Err(HealthCheckError) is more sensible than Ok(HealthCheck::Failed). Putting something that indicates failure (in your case the heath check) in the Ok branch feels wrong to me.
Right, i'm just wondering if it's good to distinguish between, "I did everything right, but the thing im checking is in an errored state" and "I couldn't even check because i'm in an errored state"