diff options
author | Michael Butler <butlermichael@google.com> | 2020-11-22 20:25:34 -0800 |
---|---|---|
committer | Michael Butler <butlermichael@google.com> | 2020-12-07 22:58:39 +0000 |
commit | 61f508e018cff89c93a7e08b3dbde1eb6a2155df (patch) | |
tree | a2f8548dad0e6895417427fcfca614ccf2d857c5 /neuralnetworks/utils/common/src/ProtectCallback.cpp | |
parent | cb3498d91b3a666b852850781538f8f228a549db (diff) |
Cleanup how transport errors are handled in NN utils
Prior to this change, whenever the NN utility code encountered a HIDL
transport error, the error message would display the file and line
number of the "handleTransportError" function itself. This change
introduces a new macro "HANDLE_TRANSPORT_FAILURE" that handles the
transport error in a similar way but now the error message displays
the file and line number of where the macro is called.
Bug: N/A
Test: mma
Change-Id: I35b34f8f5be52b7fcff0fbb58a37ab2b8c7dd8bb
Diffstat (limited to 'neuralnetworks/utils/common/src/ProtectCallback.cpp')
-rw-r--r-- | neuralnetworks/utils/common/src/ProtectCallback.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/neuralnetworks/utils/common/src/ProtectCallback.cpp b/neuralnetworks/utils/common/src/ProtectCallback.cpp index 1d9a3074db..abe4cb675e 100644 --- a/neuralnetworks/utils/common/src/ProtectCallback.cpp +++ b/neuralnetworks/utils/common/src/ProtectCallback.cpp @@ -58,7 +58,7 @@ nn::GeneralResult<DeathHandler> DeathHandler::create(sp<hidl::base::V1_0::IBase> auto deathRecipient = sp<DeathRecipient>::make(); const auto ret = object->linkToDeath(deathRecipient, /*cookie=*/0); - const bool success = NN_TRY(handleTransportError(ret)); + const bool success = HANDLE_TRANSPORT_FAILURE(ret); if (!success) { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "IBase::linkToDeath returned false"; } |