Status
extends Message
in package
The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details.
You can find out more about this error model and how to work with it in the API Design Guide.
Generated from protobuf message google.rpc.Status
Table of Contents
Properties
- $code : mixed
- The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
- $message : mixed
- A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
- $details : mixed
- A list of messages that carry the error details. There is a common set of message types for APIs to use.
Methods
- __construct() : mixed
- Constructor.
- getCode() : int
- The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
- getDetails() : RepeatedField
- A list of messages that carry the error details. There is a common set of message types for APIs to use.
- getMessage() : string
- A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
- setCode() : $this
- The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
- setDetails() : $this
- A list of messages that carry the error details. There is a common set of message types for APIs to use.
- setMessage() : $this
- A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
Properties
$code
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
protected
mixed
$code
= 0
Generated from protobuf field int32 code = 1 [json_name = "code"];
$message
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
protected
mixed
$message
= ''
Generated from protobuf field string message = 2 [json_name = "message"];
$details
A list of messages that carry the error details. There is a common set of message types for APIs to use.
private
mixed
$details
Generated from protobuf field repeated .google.protobuf.Any details = 3 [json_name = "details"];
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $data = NULL ]) : mixed
Parameters
- $data : array<string|int, mixed> = NULL
-
{ Optional. Data for populating the Message object.
@type int $code The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. @type string $message A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $details A list of messages that carry the error details. There is a common set of message types for APIs to use.}
getCode()
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
public
getCode() : int
Generated from protobuf field int32 code = 1 [json_name = "code"];
Return values
intgetDetails()
A list of messages that carry the error details. There is a common set of message types for APIs to use.
public
getDetails() : RepeatedField
Generated from protobuf field repeated .google.protobuf.Any details = 3 [json_name = "details"];
Return values
RepeatedFieldgetMessage()
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
public
getMessage() : string
Generated from protobuf field string message = 2 [json_name = "message"];
Return values
stringsetCode()
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
public
setCode(int $var) : $this
Generated from protobuf field int32 code = 1 [json_name = "code"];
Parameters
- $var : int
Return values
$thissetDetails()
A list of messages that carry the error details. There is a common set of message types for APIs to use.
public
setDetails(array<string|int, Any>|RepeatedField $var) : $this
Generated from protobuf field repeated .google.protobuf.Any details = 3 [json_name = "details"];
Parameters
- $var : array<string|int, Any>|RepeatedField
Return values
$thissetMessage()
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
public
setMessage(string $var) : $this
Generated from protobuf field string message = 2 [json_name = "message"];
Parameters
- $var : string