class Status
Defined at line 52 of file ../../src/developer/debug/shared/status.h
A cross-platform status value. It has three modes:
- OK. This is generated by the default constructor and indicates "no error".
- Platform error: This is generated by one of the above platform-specific helpers. It has a
platform error value (zx_status_t or errno), and it also looks up the corresponding string
from the operating system.
- Cross-platform error: This can be one of a specific set of enum values that we need to handle
specially from a code perspective, or a generic error with just a message. There is no
platform_error number. There may or may not be a message.
Public Methods
void Status ()
No error. For error construction, use one of the helpers above.
Defined at line 68 of file ../../src/developer/debug/shared/status.h
bool ok ()
Defined at line 86 of file ../../src/developer/debug/shared/status.h
bool has_error ()
Defined at line 87 of file ../../src/developer/debug/shared/status.h
Type type ()
Defined at line 88 of file ../../src/developer/debug/shared/status.h
void Status (std::string msg)
Constructor for a generic platform-independent error. The string may or may not be empty.
Defined at line 91 of file ../../src/developer/debug/shared/status.cc
int64_t platform_error ()
Assumes the type == kPlatformError.
Defined at line 91 of file ../../src/developer/debug/shared/status.h
void Status (Type t, std::string msg)
Constructor for a platform-independent error. The string is optional.
A type of kSuccess or kPlatformError will assert (use the platform-specific helpers above).
Defined at line 93 of file ../../src/developer/debug/shared/status.cc
const std::string & message ()
The message may or may not be set on error.
Defined at line 94 of file ../../src/developer/debug/shared/status.h
bool operator== (const Status & other)
Defined at line 96 of file ../../src/developer/debug/shared/status.h
void Status (InternalValues tag, Type t, uint64_t pe, std::string msg)
Defined at line 97 of file ../../src/developer/debug/shared/status.cc
bool operator!= (const Status & other)
Defined at line 100 of file ../../src/developer/debug/shared/status.h
void Serialize (Serializer & ser, uint32_t ver)
Defined at line 102 of file ../../src/developer/debug/shared/status.h
Enumerations
enum Type
| Name | Value |
|---|---|
| kSuccess | 0 |
| kGenericError | 1 |
| kNotSupported | 2 |
| kNotFound | 3 |
| kAlreadyExists | 4 |
| kNoResources | 5 |
| kPlatformError | 6 |
| kLast | 7 |
Defined at line 54 of file ../../src/developer/debug/shared/status.h