You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/05/17 10:58:53 UTC

[GitHub] [trafficserver] brbzull0 commented on a diff in pull request #8852: traffic_ctl - JSONRPC: make sure we display the error regardless of the formatting type.

brbzull0 commented on code in PR #8852:
URL: https://github.com/apache/trafficserver/pull/8852#discussion_r874673363


##########
include/shared/rpc/RPCRequests.h:
##########
@@ -203,23 +203,15 @@ operator<<(std::ostream &os, const RecordLookUpResponse::RecordError &re)
 inline std::ostream &
 operator<<(std::ostream &os, const JSONRPCError &err)
 {
-  os << "Error found.\n";
-  os << "code: " << err.code << '\n';
-  os << "message: " << err.message << '\n';
+  os << "Server Error found:\n";
+  os << "[" << err.code << "] " << err.message << '\n';
   if (err.data.size() > 0) {
-    os << "---\nAdditional error information found:\n";
-    auto my_print = [&](auto const &e) {
-      os << "+ code: " << e.first << '\n';
-      os << "+ message: " << e.second << '\n';
-    };
-
     auto iter = std::begin(err.data);
 
-    my_print(*iter);
+    os << "- [" << iter->first << "] " << iter->second << '\n';
     ++iter;
     for (; iter != std::end(err.data); ++iter) {
-      os << "---\n";
-      my_print(*iter);
+      os << "- [" << iter->first << "] " << iter->second << '\n';

Review Comment:
   True.  Missed that, thanks a lot, fixed now.



-- 
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