Represents success or an error with info about the error.
This class is typically used to indicate whether or not a function or other operation completed successfully. Success is indicated by an "OK" status. OK statuses will have.code()==StatusCode::kOkand.ok()== true, with all other properties having empty values. All OK statuses are equal. Any non-OKStatusis considered an error. Users can inspect the error using the member functions, or they can simply stream theStatusobject, and it will print itself in some human readable way (the streamed format may change over time and you shouldnotdepend on the specific format of a streamedStatusobject remaining unchanged).
This is a regular value type that can be copied, moved, compared for equality, and streamed.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe provided content is a reference document for the \u003ccode\u003eStatus\u003c/code\u003e class in the Google Cloud C++ library, with version 2.10.1 being one of the available versions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eStatus\u003c/code\u003e class indicates the success or failure of an operation, with \u003ccode\u003eStatusCode::kOk\u003c/code\u003e representing success and non-\u003ccode\u003eStatusCode::kOk\u003c/code\u003e values representing errors.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods such as \u003ccode\u003eok()\u003c/code\u003e, \u003ccode\u003ecode()\u003c/code\u003e, \u003ccode\u003emessage()\u003c/code\u003e, and \u003ccode\u003eerror_info()\u003c/code\u003e to inspect the status and retrieve details about any encountered errors.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eStatus\u003c/code\u003e objects can be copied, moved, compared, and streamed, and the document provides a list of links to different versions of the Status Class, including the latest, 2.37.0-rc.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eStatus\u003c/code\u003e class has constructors, a destructor, operators, and functions, that allow users to create, initialize and manage \u003ccode\u003eStatus\u003c/code\u003e objects, whether they are successful or not.\u003c/p\u003e\n"]]],[],null,["# Class google::cloud::Status (2.10.1)\n\nVersion 2.10.1keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Status)\n- [2.41.0](/cpp/docs/reference/common/2.41.0/classgoogle_1_1cloud_1_1Status)\n- [2.40.0](/cpp/docs/reference/common/2.40.0/classgoogle_1_1cloud_1_1Status)\n- [2.39.0](/cpp/docs/reference/common/2.39.0/classgoogle_1_1cloud_1_1Status)\n- [2.38.0](/cpp/docs/reference/common/2.38.0/classgoogle_1_1cloud_1_1Status)\n- [2.37.0](/cpp/docs/reference/common/2.37.0/classgoogle_1_1cloud_1_1Status)\n- [2.36.0](/cpp/docs/reference/common/2.36.0/classgoogle_1_1cloud_1_1Status)\n- [2.35.0](/cpp/docs/reference/common/2.35.0/classgoogle_1_1cloud_1_1Status)\n- [2.34.0](/cpp/docs/reference/common/2.34.0/classgoogle_1_1cloud_1_1Status)\n- [2.33.0](/cpp/docs/reference/common/2.33.0/classgoogle_1_1cloud_1_1Status)\n- [2.32.0](/cpp/docs/reference/common/2.32.0/classgoogle_1_1cloud_1_1Status)\n- [2.31.0](/cpp/docs/reference/common/2.31.0/classgoogle_1_1cloud_1_1Status)\n- [2.30.0](/cpp/docs/reference/common/2.30.0/classgoogle_1_1cloud_1_1Status)\n- [2.29.0](/cpp/docs/reference/common/2.29.0/classgoogle_1_1cloud_1_1Status)\n- [2.28.0](/cpp/docs/reference/common/2.28.0/classgoogle_1_1cloud_1_1Status)\n- [2.27.0](/cpp/docs/reference/common/2.27.0/classgoogle_1_1cloud_1_1Status)\n- [2.26.0](/cpp/docs/reference/common/2.26.0/classgoogle_1_1cloud_1_1Status)\n- [2.25.1](/cpp/docs/reference/common/2.25.1/classgoogle_1_1cloud_1_1Status)\n- [2.24.0](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Status)\n- [2.23.0](/cpp/docs/reference/common/2.23.0/classgoogle_1_1cloud_1_1Status)\n- [2.22.1](/cpp/docs/reference/common/2.22.1/classgoogle_1_1cloud_1_1Status)\n- [2.21.0](/cpp/docs/reference/common/2.21.0/classgoogle_1_1cloud_1_1Status)\n- [2.20.0](/cpp/docs/reference/common/2.20.0/classgoogle_1_1cloud_1_1Status)\n- [2.19.0](/cpp/docs/reference/common/2.19.0/classgoogle_1_1cloud_1_1Status)\n- [2.18.0](/cpp/docs/reference/common/2.18.0/classgoogle_1_1cloud_1_1Status)\n- [2.17.0](/cpp/docs/reference/common/2.17.0/classgoogle_1_1cloud_1_1Status)\n- [2.16.0](/cpp/docs/reference/common/2.16.0/classgoogle_1_1cloud_1_1Status)\n- [2.15.1](/cpp/docs/reference/common/2.15.1/classgoogle_1_1cloud_1_1Status)\n- [2.14.0](/cpp/docs/reference/common/2.14.0/classgoogle_1_1cloud_1_1Status)\n- [2.13.0](/cpp/docs/reference/common/2.13.0/classgoogle_1_1cloud_1_1Status)\n- [2.12.0](/cpp/docs/reference/common/2.12.0/classgoogle_1_1cloud_1_1Status)\n- [2.11.0](/cpp/docs/reference/common/2.11.0/classgoogle_1_1cloud_1_1Status)\n- [2.10.1](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status) \nRepresents success or an error with info about the error. \nThis class is typically used to indicate whether or not a function or other operation completed successfully. Success is indicated by an \"OK\" status. OK statuses will have `.`[`code()`](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status#classgoogle_1_1cloud_1_1Status_1ac18337d2ceb00ca007725d21f2c63f9f)`==`[`StatusCode::kOk`](/cpp/docs/reference/common/2.10.1/namespacegoogle_1_1cloud) and `.`[`ok()`](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status#classgoogle_1_1cloud_1_1Status_1a18952043ffe5a4f74911c8146e8bb504)`== true`, with all other properties having empty values. All OK statuses are equal. Any non-OK [`Status`](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status) is considered an error. Users can inspect the error using the member functions, or they can simply stream the [`Status`](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status) object, and it will print itself in some human readable way (the streamed format may change over time and you should *not* depend on the specific format of a streamed [`Status`](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status) object remaining unchanged).\n\nThis is a regular value type that can be copied, moved, compared for equality, and streamed.\n\nConstructors\n------------\n\n### Status\n\n### Status\n\n### Status\n\nDefault constructor, initializes to [`StatusCode::kOk`](/cpp/docs/reference/common/2.10.1/namespacegoogle_1_1cloud).\n\n### \\~Status\n\nDestructor.\n\n### Status\n\nConstruct from a status code, message and (optional) error info.\n\nOperators\n---------\n\n### operator=\n\n### operator=\n\nFunctions\n---------\n\n### ok\n\nReturns true if the status code is [`StatusCode::kOk`](/cpp/docs/reference/common/2.10.1/namespacegoogle_1_1cloud).\n\n### code\n\nReturns the status code.\n\n### message\n\nReturns the message associated with the status. \nThis is always empty if [`code()`](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status#classgoogle_1_1cloud_1_1Status_1ac18337d2ceb00ca007725d21f2c63f9f) is [`StatusCode::kOk`](/cpp/docs/reference/common/2.10.1/namespacegoogle_1_1cloud).\n\n### error_info\n\nReturns the additional error info associated with the status. \nThis is always a default-constructed error info if [`code()`](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Status#classgoogle_1_1cloud_1_1Status_1ac18337d2ceb00ca007725d21f2c63f9f) is [`StatusCode::kOk`](/cpp/docs/reference/common/2.10.1/namespacegoogle_1_1cloud)."]]