Re: [asio-users] asio and good error handling
Brought to you by:
chris_kohlhoff
From: Bjorn R. <br...@ma...> - 2018-12-28 16:32:20
|
On 12/28/18 5:17 AM, Vinnie Falco wrote: > understand them). The blog posts and tutorials floating around the web > can sometimes be a little cryptic with references to "system" errors > and that sort of nonsense. > > I find it easiest to explain error_condition as the equivalent of an > "error group." That is, multiple distinct values of error_code can map > to the same error_condition. This allows code which can fail to > concisely provide the exact cause of failure (error_code) while also > allowing the code to determine the general category of error. As one of said blog posts succinctly states: <quote> Use std::error_code for error propagation. Use std::error_code for comparison within a category. Use std::error_condition for comparison between categories. </quote> |