[Yunq] Return status from client calls.

This commit is contained in:
Drew Galbraith 2023-12-01 10:35:42 -08:00
parent 700f3f94cb
commit c209925a3c
25 changed files with 102 additions and 112 deletions

View file

@ -11,11 +11,11 @@ class Status {
Status(ErrorCode code) : code_(code), message_() {}
Status(ErrorCode code, StringView message) : code_(code), message_(message) {}
explicit operator bool() { return ok(); }
bool ok() { return code_ == OK; }
explicit operator bool() const { return ok(); }
bool ok() const { return code_ == OK; }
ErrorCode code() { return code_; }
StringView message() { return message_; }
ErrorCode code() const { return code_; }
StringView message() const { return message_; }
private:
ErrorCode code_;