jpeach commented on code in PR #9878:
URL: https://github.com/apache/trafficserver/pull/9878#discussion_r1266064448
##########
include/tscpp/util/ts_errata.h:
##########
@@ -40,5 +40,16 @@ static constexpr std::array<swoc::TextView, 9>
Severity_Names{
{"Diag", "Debug", "Status", "Note", "Warn", "Error", "Fatal", "Alert",
"Emergency"}
};
+inline std::error_code
+ec_for()
+{
+ return {errno, std::system_category()};
Review Comment:
And that that text continues:
```
It is also required to override the virtual function
[std::error_category::default_error_condition()](https://en.cppreference.com/w/cpp/error/error_category/default_error_condition)
to map the error codes that match POSIX
[errno](https://en.cppreference.com/w/cpp/error/errno) values to
[std::generic_category](https://en.cppreference.com/w/cpp/error/generic_category).
```
So, this means that system category is required to forward errno values to
generic category? TBH this error abstraction seems to provide more confusion
that value 🤷
##########
include/tscpp/util/ts_errata.h:
##########
@@ -40,5 +40,16 @@ static constexpr std::array<swoc::TextView, 9>
Severity_Names{
{"Diag", "Debug", "Status", "Note", "Warn", "Error", "Fatal", "Alert",
"Emergency"}
};
+inline std::error_code
+ec_for()
+{
+ return {errno, std::system_category()};
Review Comment:
And that that text continues:
```
It is also required to override the virtual function
[std::error_category::default_error_condition()](https://en.cppreference.com/w/cpp/error/error_category/default_error_condition)
to map the error codes that match POSIX
[errno](https://en.cppreference.com/w/cpp/error/errno) values to
[std::generic_category](https://en.cppreference.com/w/cpp/error/generic_category).
```
So, this means that system category is required to forward errno values to
generic category? TBH this error abstraction seems to provide more confusion
that value 🤷
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]