Status
Status
türü, REST API'ler ve RPC API'leri dahil olmak üzere farklı programlama ortamları için uygun bir mantıksal hata modelini tanımlar. gRPC tarafından kullanılır. Her Status
mesajı üç veri parçası içerir: hata kodu, hata mesajı ve hata ayrıntıları.
API Tasarım Kılavuzu'nda bu hata modeli ve bu hata modeliyle nasıl çalışılacağı hakkında daha fazla bilgi edinebilirsiniz.
JSON gösterimi |
{
"code": integer,
"message": string,
"details": [
{
"@type": string,
field1: ...,
...
}
]
} |
Alanlar |
code |
integer
google.rpc.Code olması gereken durum kodu.
|
message |
string
Geliştiricilere yönelik, İngilizce olması gereken bir hata mesajı. Kullanıcılara yönelik tüm hata mesajları yerelleştirilip google.rpc.Status.details alanında gönderilmeli veya istemci tarafından yerelleştirilmelidir.
|
details[] |
object
Hata ayrıntılarını içeren mesajların listesi. API'lerin kullandığı bir dizi mesaj türü vardır. Rastgele türden alanlar içeren nesne. Ek bir "@type" alanı, türü tanımlayan bir URI içerir. Örnek: { "id": 1234, "@type": "types.example.com/standard/id" } .
|
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-09-05 UTC.
[null,null,["Son güncelleme tarihi: 2024-09-05 UTC."],[[["The `Status` type is a structured approach to define errors in APIs that's suitable for various programming environments, including REST and RPC."],["Each `Status` message includes an error code, a message intended for developers, and optional details that can hold localized or additional information."],["These error details are provided as a list of objects with a designated type specified using the `@type` field for clarity and structured data representation."]]],["The `Status` type represents a logical error model with three data components: `code`, `message`, and `details`. `code` is an integer status code. `message` is a developer-facing English error message, while user-facing messages should be localized and sent in `details`. `details` is a list of objects carrying specific error information, with each object including a \"@type\" field for type identification. This model is used in REST and RPC APIs, and is also used by gRPC.\n"]]