From 13f343ec968a7b9a98416f1dbefc59d91244d9af Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Sat, 28 Mar 2020 16:03:01 -0700 Subject: [PATCH] Resolve minor review comment --- fdbserver/RestoreApplier.actor.cpp | 3 +-- fdbserver/RestoreMaster.actor.cpp | 15 +++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/fdbserver/RestoreApplier.actor.cpp b/fdbserver/RestoreApplier.actor.cpp index 2c86fa6560..47529e2316 100644 --- a/fdbserver/RestoreApplier.actor.cpp +++ b/fdbserver/RestoreApplier.actor.cpp @@ -222,8 +222,7 @@ ACTOR static Future getAndComputeStagingKeys( retries++; TraceEvent(retries > 10 ? SevError : SevWarn, "FastRestoreApplierGetAndComputeStagingKeysUnhandledError") .detail("GetKeys", incompleteStagingKeys.size()) - .detail("Error", e.what()) - .detail("ErrorCode", e.code()); + .error(e); wait(tr->onError(e)); fValues.clear(); } diff --git a/fdbserver/RestoreMaster.actor.cpp b/fdbserver/RestoreMaster.actor.cpp index f6933ef8b8..a5a5a87b2c 100644 --- a/fdbserver/RestoreMaster.actor.cpp +++ b/fdbserver/RestoreMaster.actor.cpp @@ -84,10 +84,7 @@ ACTOR Future startRestoreMaster(Reference masterWorker, wait(startProcessRestoreRequests(self, cx)); } catch (Error& e) { if (e.code() != error_code_operation_cancelled) { - TraceEvent(SevError, "FastRestoreMasterStart") - .detail("Reason", "Unexpected unhandled error") - .detail("ErrorCode", e.code()) - .detail("Error", e.what()); + TraceEvent(SevError, "FastRestoreMasterStart").detail("Reason", "Unexpected unhandled error").error(e); } } @@ -204,15 +201,13 @@ ACTOR Future startProcessRestoreRequests(Reference self } catch (Error& e) { if (restoreIndex < restoreRequests.size()) { TraceEvent(SevError, "FastRestoreMasterProcessRestoreRequestsFailed", self->id()) - .detail("Error", e.what()) - .detail("ErrorCode", e.code()) - .detail("RestoreRequest", restoreRequests[restoreIndex].toString()); + .detail("RestoreRequest", restoreRequests[restoreIndex].toString()) + .error(e); } else { TraceEvent(SevError, "FastRestoreMasterProcessRestoreRequestsFailed", self->id()) - .detail("Error", e.what()) - .detail("ErrorCode", e.code()) .detail("RestoreRequests", restoreRequests.size()) - .detail("RestoreIndex", restoreIndex); + .detail("RestoreIndex", restoreIndex) + .error(e); } }