Browse Source

!6900 Fix a merge error of status.h

Merge pull request !6900 from JesseKLee/status_merge_err
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
2a41f76f4f
2 changed files with 14 additions and 2 deletions
  1. +12
    -0
      mindspore/ccsrc/minddata/dataset/include/status.h
  2. +2
    -2
      mindspore/ccsrc/minddata/dataset/util/status.h

+ 12
- 0
mindspore/ccsrc/minddata/dataset/include/status.h View File

@@ -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_;


+ 2
- 2
mindspore/ccsrc/minddata/dataset/util/status.h View File

@@ -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
};


Loading…
Cancel
Save