]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: print exceptions using exception.what()
authorKefu Chai <tchaikov@gmail.com>
Tue, 22 Nov 2022 03:56:36 +0000 (11:56 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 22 Nov 2022 05:54:41 +0000 (13:54 +0800)
{fmt} does not support formatting exceptions until
https://github.com/fmtlib/fmt/pull/3062/commits/76adb05a78a026b94c2ecadd20c00ae0c33c5a37
so we need to print them via exception.what().

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/crimson/net/ProtocolV2.cc
src/crimson/os/seastore/seastore_types.cc

index 0f36066db8dbbd663b1f3685acd836eb2a660a9a..2b41e868f000898fdbf78a7df42aff290c7c03d2 100644 (file)
@@ -604,7 +604,7 @@ seastar::future<> ProtocolV2::client_auth(std::vector<uint32_t> &allowed_methods
       return handle_auth_reply();
     });
   } catch (const crimson::auth::error& e) {
-    logger().error("{} get_initial_auth_request returned {}", conn, e);
+    logger().error("{} get_initial_auth_request returned {}", conn, e.what());
     abort_in_close(*this, true);
     return seastar::now();
   }
index ef4f7f4e72eab9299bb5143e82ec7251d52ad601..432539d73ea3753463f1dd739ececf97fbf6698b 100644 (file)
@@ -591,7 +591,7 @@ try_decode_records_header(
     journal_logger().debug(
         "try_decode_records_header: failed, "
         "cannot decode record_group_header_t, got {}.",
-        e);
+        e.what());
     return std::nullopt;
   }
   if (header.segment_nonce != expected_nonce) {
@@ -654,7 +654,7 @@ try_decode_record_headers(
       journal_logger().debug(
           "try_decode_record_headers: failed, "
           "cannot decode record_header_t, got {}.",
-          e);
+          e.what());
       return std::nullopt;
     }
   }
@@ -690,7 +690,7 @@ try_decode_extent_infos(
         journal_logger().debug(
             "try_decode_extent_infos: failed, "
             "cannot decode extent_info_t, got {}.",
-            e);
+            e.what());
         return std::nullopt;
       }
     }
@@ -734,7 +734,7 @@ try_decode_deltas(
         journal_logger().debug(
             "try_decode_deltas: failed, "
             "cannot decode delta_info_t, got {}.",
-            e);
+            e.what());
         return std::nullopt;
       }
     }