From 70f7e1df3f9e62bbe0d197e4d346a286df49a1d3 Mon Sep 17 00:00:00 2001 From: Jesse Lee Date: Fri, 25 Sep 2020 10:04:51 -0400 Subject: [PATCH] Fix merge error --- mindspore/ccsrc/minddata/dataset/include/status.h | 12 ++++++++++++ mindspore/ccsrc/minddata/dataset/util/status.h | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/minddata/dataset/include/status.h b/mindspore/ccsrc/minddata/dataset/include/status.h index bb6a787914..9f45e12c68 100644 --- a/mindspore/ccsrc/minddata/dataset/include/status.h +++ b/mindspore/ccsrc/minddata/dataset/include/status.h @@ -59,6 +59,13 @@ namespace dataset { } \ } while (false) +#define RETURN_OK_IF_TRUE(_condition) \ + do { \ + if (_condition) { \ + return Status::OK(); \ + } \ + } while (false) + enum class StatusCode : char { kOK = 0, kOutOfMemory = 1, @@ -74,6 +81,9 @@ enum class StatusCode : char { kBoundingBoxOutOfBounds = 11, kBoundingBoxInvalidShape = 12, kSyntaxError = 13, + kTimeOut = 14, + kBuddySpaceFull = 15, + kNetWorkError = 16, // Make this error code the last one. Add new error code above it. kUnexpectedError = 127 }; @@ -129,6 +139,8 @@ class Status { bool IsNoSpace() const { return (get_code() == StatusCode::kNoSpace); } + bool IsNetWorkError() const { return (get_code() == StatusCode::kNetWorkError); } + private: StatusCode code_; std::string err_msg_; diff --git a/mindspore/ccsrc/minddata/dataset/util/status.h b/mindspore/ccsrc/minddata/dataset/util/status.h index 5bb9b5815e..9f45e12c68 100644 --- a/mindspore/ccsrc/minddata/dataset/util/status.h +++ b/mindspore/ccsrc/minddata/dataset/util/status.h @@ -82,8 +82,8 @@ enum class StatusCode : char { kBoundingBoxInvalidShape = 12, kSyntaxError = 13, kTimeOut = 14, - kBuddySpaceFull = 14, - kNetWorkError = 15, + kBuddySpaceFull = 15, + kNetWorkError = 16, // Make this error code the last one. Add new error code above it. kUnexpectedError = 127 };