You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "ywkaras (via GitHub)" <gi...@apache.org> on 2023/06/22 23:25:01 UTC

[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9875: libswoc: Update WCCP use of Errata.

ywkaras commented on code in PR #9875:
URL: https://github.com/apache/trafficserver/pull/9875#discussion_r1239121564


##########
include/tscpp/util/ts_errata.h:
##########
@@ -35,10 +37,34 @@ static constexpr swoc::Errata::Severity ERRATA_FATAL{DL_Fatal};
 static constexpr swoc::Errata::Severity ERRATA_ALERT{DL_Alert};
 static constexpr swoc::Errata::Severity ERRATA_EMERGENCY{DL_Emergency};
 
+inline DiagsLevel
+diags_level_of(swoc::Errata::Severity s)
+{
+  return static_cast<DiagsLevel>(static_cast<int>(s));
+}
+
+inline std::error_code
+ec_for()
+{
+  return std::error_code(errno, std::system_category());
+}
+inline std::error_code
+ec_for(int e)

Review Comment:
   You could eliminate the overload by making errno be the default value for e.



-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org