class Status
Defined at line 120 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
`Status` is a thin, zero-cost abstraction around the `pw_Status` enum. It
initializes to `pw::OkStatus()` by default and adds `ok()` and `str()`
methods. Implicit conversions are permitted between `pw_Status` and
`pw::Status`.
An OK status is created by the `pw::OkStatus()` function or by the default
`Status` constructor. Non-OK `Status` is created with a static member
function that corresponds with the status code. Example:
Code
{.cpp}
using pw::Status;
Status OperationThatFails() {
// …
return Status::DataLoss();
}
Public Methods
Status Cancelled ()
Operation was cancelled, typically by the caller.
Defined at line 139 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status Unknown ()
Unknown error occurred. Avoid this code when possible.
Defined at line 151 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status InvalidArgument ()
Argument was malformed; e.g. invalid characters when parsing integer.
Defined at line 164 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status DeadlineExceeded ()
Deadline passed before operation completed.
Defined at line 177 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status NotFound ()
The entity that the caller requested (e.g. file or directory) is not
found.
Defined at line 190 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status AlreadyExists ()
The entity that the caller requested to create is already present.
Defined at line 203 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status PermissionDenied ()
Caller lacks permission to execute action.
Defined at line 216 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status ResourceExhausted ()
Insufficient resources to complete operation; e.g. supplied buffer is too
small.
Defined at line 230 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status FailedPrecondition ()
System isn’t in the required state; e.g. deleting a non-empty directory.
Defined at line 243 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status Aborted ()
Operation aborted due to e.g. concurrency issue or failed transaction.
Defined at line 255 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status OutOfRange ()
Operation attempted out of range; e.g. seeking past end of file.
Defined at line 267 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status Unimplemented ()
Operation isn’t implemented or supported.
Defined at line 280 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status Internal ()
Internal error occurred; e.g. system invariants were violated.
Defined at line 292 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status Unavailable ()
Requested operation can’t finish now, but may at a later time.
Defined at line 304 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status DataLoss ()
Unrecoverable data loss occurred while completing the requested operation.
Defined at line 316 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status Unauthenticated ()
Caller does not have valid authentication credentials for the operation.
Defined at line 329 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
void Status (Code code)
Statuses are created with a `Status::Code`.
Defined at line 335 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
void Status (const Status & )
Defined at line 337 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Status & operator= (const Status & )
Defined at line 338 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
Code code ()
Defined at line 341 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool ok ()
This function is provided in place of an `IsOk()` function.
Defined at line 346 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsCancelled ()
Defined at line 349 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsUnknown ()
Defined at line 353 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsInvalidArgument ()
Defined at line 357 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsDeadlineExceeded ()
Defined at line 361 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsNotFound ()
Defined at line 365 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsAlreadyExists ()
Defined at line 369 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsPermissionDenied ()
Defined at line 373 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsResourceExhausted ()
Defined at line 377 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsFailedPrecondition ()
Defined at line 381 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsAborted ()
Defined at line 385 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsOutOfRange ()
Defined at line 389 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsUnimplemented ()
Defined at line 393 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsInternal ()
Defined at line 397 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsUnavailable ()
Defined at line 401 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsDataLoss ()
Defined at line 405 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
bool IsUnauthenticated ()
Defined at line 409 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
void Update (Status other)
Updates this `Status` to the `other` IF this status is
`pw::OkStatus()`.
This is useful for tracking the first encountered error,
as calls to this helper will not change one error status to another error
status.
Defined at line 419 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
void IgnoreError ()
Ignores any errors.
This method does nothing except potentially suppress
complaints from any tools that are checking that errors are not dropped on
the floor.
Defined at line 430 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h
const char * str ()
Defined at line 433 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h