diff options
Diffstat (limited to 'persistence/src/vespa/persistence/spi/result.h')
-rw-r--r-- | persistence/src/vespa/persistence/spi/result.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/persistence/src/vespa/persistence/spi/result.h b/persistence/src/vespa/persistence/spi/result.h index 0daa784caa4..fe8e74706bb 100644 --- a/persistence/src/vespa/persistence/spi/result.h +++ b/persistence/src/vespa/persistence/spi/result.h @@ -13,7 +13,7 @@ class Result { public: typedef std::unique_ptr<Result> UP; - enum ErrorType { + enum class ErrorType { NONE, TRANSIENT_ERROR, PERMANENT_ERROR, @@ -26,7 +26,7 @@ public: /** * Constructor to use for a result where there is no error. */ - Result() : _errorCode(NONE), _errorMessage() {} + Result() : _errorCode(ErrorType::NONE), _errorMessage() {} /** * Constructor to use when an error has been detected. @@ -46,7 +46,7 @@ public: } bool hasError() const { - return _errorCode != NONE; + return _errorCode != ErrorType::NONE; } ErrorType getErrorCode() const { @@ -66,6 +66,8 @@ private: std::ostream & operator << (std::ostream & os, const Result & r); +std::ostream & operator << (std::ostream & os, const Result::ErrorType &errorCode); + class BucketInfoResult : public Result { public: /** |