[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# google-cloud-errors - Class Google::Cloud::Error (v1.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.0 (latest)](/ruby/docs/reference/google-cloud-errors/latest/Google-Cloud-Error)\n- [1.4.0](/ruby/docs/reference/google-cloud-errors/1.4.0/Google-Cloud-Error)\n- [1.3.1](/ruby/docs/reference/google-cloud-errors/1.3.1/Google-Cloud-Error)\n- [1.2.0](/ruby/docs/reference/google-cloud-errors/1.2.0/Google-Cloud-Error) \nReference documentation and code samples for the google-cloud-errors class Google::Cloud::Error.\n\nBase google-cloud exception class. \n\nInherits\n--------\n\n- StandardError\n\nMethods\n-------\n\n### #body\n\n def body() -\u003e Object, nil\n\nReturns the value of `body` from the underlying cause error\nobject, if both are present. Otherwise returns `nil`.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover HTTP/REST. \n**Returns**\n\n- (Object, nil)\n\n### #code\n\n def code() -\u003e Object, nil\n\nReturns the value of `code` from the underlying cause error\nobject, if both are present. Otherwise returns `nil`.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover gRPC. \n**Returns**\n\n- (Object, nil)\n\n### #details\n\n def details() -\u003e Object, nil\n\nReturns the value of `details` from the underlying cause error\nobject, if both are present. Otherwise returns `nil`.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover gRPC. \n**Returns**\n\n- (Object, nil)\n\n### #domain\n\n def domain() -\u003e Object, nil\n\nReturns the value of `domain` from the `::Google::Rpc::ErrorInfo`\nobject, if it exists in the `status_details` array.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover gRPC. \n**Returns**\n\n- (Object, nil)\n\n### #error_info\n\n def error_info() -\u003e ::Google::Rpc::ErrorInfo, nil\n\nReturns the `::Google::Rpc::ErrorInfo` object present in the `status_details`\nor `details` array, given that the following is true:\n\n- either `status_details` or `details` exists and is an array\n- there is exactly one `::Google::Rpc::ErrorInfo` object in that array. Looks in `status_details` first, then in `details`. \n**Returns**\n\n- (::Google::Rpc::ErrorInfo, nil)\n\n### #error_metadata\n\n def error_metadata() -\u003e Hash, nil\n\nReturns the value of `metadata` from the `::Google::Rpc::ErrorInfo`\nobject, if it exists in the `status_details` array.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover gRPC. \n**Returns**\n\n- (Hash, nil)\n\n### #header\n\n def header() -\u003e Object, nil\n\nReturns the value of `header` from the underlying cause error\nobject, if both are present. Otherwise returns `nil`.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover HTTP/REST. \n**Returns**\n\n- (Object, nil)\n\n### #initialize\n\n def initialize(msg = nil) -\u003e Error\n\nConstruct a new Google::Cloud::Error object, optionally passing in a\nmessage. \n**Parameter**\n\n- **msg** (String, nil) --- an error message \n**Returns**\n\n- ([Error](./Google-Cloud-Error)) --- a new instance of Error\n\n### #metadata\n\n def metadata() -\u003e Object, nil\n\nReturns the value of `metadata` from the underlying cause error\nobject, if both are present. Otherwise returns `nil`.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover gRPC. \n**Returns**\n\n- (Object, nil)\n\n### #reason\n\n def reason() -\u003e Object, nil\n\nReturns the value of `reason` from the `::Google::Rpc::ErrorInfo`\nobject, if it exists in the `status_details` array.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover gRPC. \n**Returns**\n\n- (Object, nil)\n\n### #status_code\n\n def status_code() -\u003e Object, nil\n\nReturns the value of `status_code` from the underlying cause error\nobject, if both are present. Otherwise returns `nil`.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover HTTP/REST. \n**Returns**\n\n- (Object, nil)\n\n### #status_details\n\n def status_details() -\u003e Object, nil\n\nReturns the value of `status_details` from the underlying cause error\nobject, if both are present. Otherwise returns `nil`.\n\n\n\u003cbr /\u003e\n\nThis is typically present on errors originating from calls to an API\nover gRPC. \n**Returns**\n\n- (Object, nil)"]]