Re: [capy] Andrzej's feedback
Steve Gerbino via Boost <[email protected]> Tue, 07 Jul 2026 13:55:49 +0000
| Newsgroups | gmane.comp.lib.boost.devel |
|---|---|
| Message-ID | <T2NV4wib7Th_6Lrf1ZbY08-A3XtSH9nsmXCZkkJQ0vVUrXBnYNVIJ_ZChuPAjK-qpJcyvQwzHFwVvMM0iSIZbeakxwL1DNERrgwGjUTkby0=@gerbino.co> |
On Tuesday, July 7th, 2026 at 12:21 AM, Andrzej Krzemienski via Boost <[email protected]> wrote: > > Just to note here that this is an important observation and one I'd like to > > reiterate. "error codes are for errors" is a common misconception in this > > space. > > > Any idea where this misconception may be coming from? I think std::error_code provides the right functionality with a poor label and I suspect the label is exactly where the misconception comes from. People see "error" in the type name and assume any non-zero value signals a failure. A better name would be "status_code". There are many times when we want to express the state of something that is neither success nor failure, like peer_not_ready or block_not_linkable, where the program should do something other than either carry on as if all is well or treat it as a failure. I don't think I'm alone in this opinion. There is actually a paper P1028 that describes this idea. I also believe Boost's error_code provides a query to determine if the code actually indicates a failure, which further validates the line of thought. _______________________________________________ Boost mailing list -- [email protected] To unsubscribe send an email to [email protected] https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/[email protected]/message/JCCMHASFYYTEE37SCOO67BZQ3UO2RLVH/