Status
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Status
유형은 REST API, RPC API를 비롯하여 다양한 프로그래밍 환경에 적합한 논리적 오류 모델을 정의하며, gRPC에서 사용됩니다. 각 Status
메시지에는 오류 코드, 오류 메시지, 오류 세부정보라는 3가지 데이터가 포함됩니다.
API 설계 가이드에서 이 오류 모델과 모델 작업 방법에 대해 자세히 알아볼 수 있습니다.
JSON 표현 |
{
"code": integer,
"message": string,
"details": [
{
"@type": string,
field1: ...,
...
}
]
} |
필드 |
code |
integer
상태 코드로, google.rpc.Code 의 열거형 값이어야 합니다.
|
message |
string
개발자에게 정보를 제공하는 오류 메시지로, 영어로 작성되어야 합니다. 사용자에게 표시되는 모든 오류 메시지는 현지화되어 google.rpc.Status.details 필드에 전송되거나, 클라이언트 측에서 현지화되어야 합니다.
|
details[] |
object
오류 세부정보를 설명하는 메시지 목록입니다. API에서 사용할 일반적인 메시지 유형 집합이 있습니다. 임의 유형의 필드를 포함하는 객체입니다. 추가 필드 "@type" 은 유형을 식별하는 URI를 포함합니다. 예: { "id": 1234, "@type": "types.example.com/standard/id" }
|
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eStatus\u003c/code\u003e type is a structured approach to define errors in APIs, containing an error code, message, and details for analysis.\u003c/p\u003e\n"],["\u003cp\u003eThe error model utilizes a JSON representation with fields for code, message, and an array for detailed error information.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can integrate this model into REST APIs and RPC APIs, referencing the \u003ccode\u003egoogle.rpc.Code\u003c/code\u003e enum for standardized error codes.\u003c/p\u003e\n"],["\u003cp\u003eError messages are intended for developers and should be in English, while user-facing messages should be handled separately via localization.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edetails\u003c/code\u003e field provides flexibility by allowing arbitrary objects to convey specific error information using a URI for type identification.\u003c/p\u003e\n"]]],[],null,["# Status\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\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| JSON representation |\n|------------------------------------------------------------------------------------------------------|\n| ``` { \"code\": integer, \"message\": string, \"details\": [ { \"@type\": string, field1: ..., ... } ] } ``` |\n\n| Fields ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | `integer` 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/documentation/routes/reference/rest/v2/Status#FIELDS.details) field, or localized by the client. |\n| `details[]` | `object` A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field `\"@type\"` contains a URI identifying the type. Example: `{ \"id\": 1234, \"@type\": \"types.example.com/standard/id\" }`. |"]]