Skip to content
Snippets Groups Projects
error_code.hh 597 B
Newer Older
  • Learn to ignore specific revisions
  • #ifndef __VEREIGN_GRPC_ERROR_CODES_HH
    #define __VEREIGN_GRPC_ERROR_CODES_HH
    
    #include <cstdint>
    #include <string>
    
    namespace vereign::grpc {
    
    static constexpr const char* ClientErrorStatus = "Vereign Client Library Error";
    
    enum class ErrorCode : uint64_t {
      ClientError                 = 1000,
      UnexpectedError             = 1001,
      DeviceNotRegistered         = 1002,
      InvalidPinCode              = 1003,
      InvalidIdentity             = 1004
    };
    
    inline auto ErrorCodeAsString(ErrorCode ec) -> std::string {
      return std::to_string(uint64_t(ec));
    }
    
    }
    
    #endif // __VEREIGN_GRPC_ERROR_CODES_HH