|
| | Status () |
| | Builds an OK Status in the canonical error space. More...
|
| |
| | Status (const Status &other)=default |
| |
| | Status (Status &&other) |
| |
| template<typename StatusT , typename E = typename absl::enable_if_t< status_internal::status_type_traits<StatusT>::is_status>> |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use " "ConvertStatus() from status_helpers.h instead.") explicit Status(const StatusT &other) |
| | Constructs a Status object from StatusT. More...
|
| |
| | Status (const absl::Status &other) |
| |
| Status & | operator= (const Status &other)=default |
| |
| Status & | operator= (Status &&other) |
| |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use " "absl::OkStatus() or asylo::OkStatus() instead.") static Status OkStatus() |
| | Constructs an OK status object. More...
|
| |
| template<typename StatusT , typename E = typename absl::enable_if_t< status_internal::status_type_traits<StatusT>::is_status>> |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use " "ConvertStatus() from status_helpers.h instead.") StatusT ToOtherStatus() |
| | Copy this object to a status type StatusT. More...
|
| |
| | operator::absl::Status () const |
| |
| template<class T > |
| | operator absl::StatusOr< T > () const |
| |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use raw_code() " "instead.") int error_code() const |
| | Gets the integer error code for this object. More...
|
| |
| int | raw_code () const |
| | Gets the error code for this object as an int. More...
|
| |
| std::string | ToString () const |
| | Gets a string representation of this object. More...
|
| |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use payloads " "instead of error spaces.") Status ToCanonical() const |
| | Gets a copy of this object in the canonical error space. More...
|
| |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use " "StatusToProto() from status_helpers.h instead.") void SaveTo(StatusProto *status_proto) const |
| | Exports the contents of this object into status_proto. More...
|
| |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use " "StatusFromProto() from status_helpers.h instead.") void RestoreFrom(const StatusProto &status_proto) |
| | Populates this object using the contents of the given status_proto. More...
|
| |
| template<typename Enum > |
| | ABSL_DEPRECATED ("Deprecated as part of Asylo's absl::Status migration. Use payloads " "instead of error spaces.") bool Is(Enum code) const |
| | Indicates whether this object is the same as code. More...
|
| |
| void | SetPayload (absl::string_view type_url, absl::Cord payload) |
| | Sets the payload for a given type URL, overwriting any previous value. More...
|
| |
| bool | ErasePayload (absl::string_view type_url) |
| | Removes the payload associated with a given type URL, if one exists. More...
|
| |
| void | ForEachPayload (const std::function< void(absl::string_view, const absl::Cord &)> &visitor) const |
| | Executes a function for each payload in this Status. More...
|
| |
| template<typename Enum > |
| ABSL_DEPRECATED( | ABSL_DEPRECATED (Enum code, absl::string_view message)"Deprecated as part of Asylo's absl::Status migration. Use payloads to " "communicate additional error information if needed.") Status(const error |
| | Constructs a Status object containing an error code and message. More...
|
| |
Status contains information about an error.
Status contains an error code from some error space and a message string suitable for logging or debugging. Status can also contain any number of (type URL -> byte string) associations called "payloads". These function similarly to payloads in absl::Status.
template<typename StatusT , typename E = typename absl::enable_if_t< status_internal::status_type_traits<StatusT>::is_status>>
| asylo::Status::ABSL_DEPRECATED |
( |
"Deprecated as part of Asylo's absl::Status migration. Use " "ConvertStatus() from status_helpers.h instead." |
| ) |
const & |
|
inline |
Constructs a Status object from StatusT.
StatusT must be a status-type object. I.e.,
- It must have a two-parameter constructor that takes an enum as its first parameter and a string as its second parameter.
- It must have non-static error_code(), error_message(), and ok() methods.
This constructor is provided for the convenience of Asylo-SDK consumers utilizing other status types such as ::grpc::Status.
- Deprecated:
- Deprecated as part of Asylo's
absl::Status migration. Use ConvertStatus() instead.
- Parameters
-
| other | A status-like object to copy. |
template<typename StatusT , typename E = typename absl::enable_if_t< status_internal::status_type_traits<StatusT>::is_status>>
| asylo::Status::ABSL_DEPRECATED |
( |
"Deprecated as part of Asylo's absl::Status migration. Use " "ConvertStatus() from status_helpers.h instead." |
| ) |
|
|
inline |
Copy this object to a status type StatusT.
The method first converts the asylo::Status object to its canonical form, and then constructs a StatusT from the error code and message fields of the converted object. StatusT must be a status-type object. I.e.,
- It must have a two-parameter constructor that takes an enum as its first parameter and a string as its second parameter.
- It must have non-static error_code(), error_message(), and ok() methods.
This operator is provided for the convenience of the Asylo SDK users that utilize other status types, such as ::grpc::Status.
- Deprecated:
- Deprecated as part of Asylo's
absl::Status migration. Use ConvertStatus() instead.
- Returns
- A status-like object copied from this object.
| asylo::Status::ABSL_DEPRECATED |
( |
"Deprecated as part of Asylo's absl::Status migration. Use " "StatusFromProto() from status_helpers.h instead." |
| ) |
const & |
Populates this object using the contents of the given status_proto.
If the error space given by status_proto.space() is unrecognized, sets the error space to the canonical error space and sets the error code using the value given by status_proto.canonical_code(). If there is no canonical code, sets the error code to absl::StatusCode::kUnknown. Note that the error message is only set if status_proto represents a non-ok Status.
If the given status_proto is invalid, sets an appropriate error code and message. A StatusProto is valid if and only if all the following conditions hold:
- If
code() is 0, then canonical_code() is set to 0.
- If
canonical_code() is 0, then code() is set to 0.
- If the error space is recognized, then
canonical_code() is equal to the equivalent canonical code given by the error space.
- Deprecated:
- Deprecated as part of Asylo's
absl::Status migration. Use StatusFromProto() instead.
- Parameters
-
| status_proto | A protobuf object to set this object from. |
| std::string asylo::Status::ToString |
( |
| ) |
const |
Gets a string representation of this object.
Gets a string containing the error space name, error code name, and error message if this object is a non-OK Status, or just a string containing the error code name if this object is an OK Status.
The string also contains a list of payloads contained in this Status.
- Returns
- A string representation of this object.