Package google.rpc
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Stan
Typ Status
definiuje model błędu logicznego, który jest odpowiedni dla różnych środowisk programistycznych, w tym interfejsów API typu REST i RPC. Jest używany przez gRPC. Każda wiadomość Status
zawiera 3 rodzaje danych: kod błędu, komunikat o błędzie i szczegóły błędu.
Więcej informacji o tym modelu błędów i sposobie pracy z nim znajdziesz w przewodniku API Design Guide (w języku angielskim).
Pola |
code |
int32
Kod stanu, który powinien być wartością wyliczeniową google.rpc.Code .
|
message |
string
Komunikat o błędzie widoczny dla programisty, który powinien być w języku angielskim. Wszelkie komunikaty o błędach wyświetlane użytkownikowi powinny być przetłumaczone i wysyłane w polu google.rpc.Status.details lub przetłumaczone przez klienta.
|
details[] |
Any
Lista wiadomości zawierających szczegóły błędu. Interfejsy API korzystają z typowego zestawu typów wiadomości.
|
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-29 UTC.
[null,null,["Ostatnia aktualizacja: 2025-08-29 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eStatus\u003c/code\u003e type defines a logical error model suitable for various programming environments, including REST and RPC APIs, and is used by gRPC.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eStatus\u003c/code\u003e message comprises three data components: an error code, an error message, and error details.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecode\u003c/code\u003e field represents the status code and is expected to be an enum value of \u003ccode\u003egoogle.rpc.Code\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emessage\u003c/code\u003e field provides a developer-facing error message in English, with user-facing messages expected to be localized elsewhere.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edetails[]\u003c/code\u003e field contains a list of messages that provide further information about the error.\u003c/p\u003e\n"]]],[],null,["# Package google.rpc\n\nIndex\n-----\n\n- [Status](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rpc/google.rpc#google.rpc.Status) (message)\n\nStatus\n------\n\nThe `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.\n\nYou can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).\n\n| Fields ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | `int32` The status code, which should be an enum value of `google.rpc.Code`. |\n| `message` | `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](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rpc/google.rpc#google.rpc.Status.FIELDS.repeated.google.protobuf.Any.google.rpc.Status.details) field, or localized by the client. |\n| `details[]` | [Any](https://protobuf.dev/reference/protobuf/google.protobuf/#any) A list of messages that carry the error details. There is a common set of message types for APIs to use. |"]]