# Error Reporting API - Module Google::Cloud (v0.45.1)

0.45.1 (latest) 0.45.0 0.44.0 0.43.0 0.42.3 Reference documentation and code samples for the Error Reporting API module Google::Cloud.

## Methods

### .error_reporting

    def self.error_reporting(project_id = nil, credentials = nil, scope: nil, timeout: nil) -> Google::Cloud::ErrorReporting::Project

Create a new object for connecting to the Error Reporting
service. Each call creates a new connection.


<br />

For more information on connecting to Google Cloud see the
[Authentication Guide](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting/latest/AUTHENTICATION "Authentication Guide").
**Parameters**

- **project_id** (String) --- Google Cloud Platform project identifier for the Error Reporting service you are connecting to. If not present, the default project for the credentials is used.
- **credentials** (String, Hash, Google::Auth::Credentials) --- The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object. (See [ErrorReporting::Credentials](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting/latest/Google-Cloud-ErrorReporting-Credentials "Google::Cloud::ErrorReporting::Credentials (class)"))
- **scope** (String, Array\<String\>) *(defaults to: nil)* ---

  The OAuth 2.0 scopes controlling the
  set of resources and operations that the connection can access. See
  [Using OAuth 2.0 to Access Google
  APIs](https://developers.google.com/identity/protocols/OAuth2).

  The default scope is:
  - `https://www.googleapis.com/auth/cloud-platform`
- **timeout** (Integer) *(defaults to: nil)* --- Default timeout to use in requests. Optional.
**Returns**

- ([Google::Cloud::ErrorReporting::Project](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting/latest/Google-Cloud-ErrorReporting-Project))
**Example**

```ruby
require "google/cloud/error_reporting"

error_reporting =
  Google::Cloud.error_reporting "GCP_Project_ID",
                                "/path/to/gcp/secretkey.json"

error_event = error_reporting.error_event "Error with Backtrace",
                                          event_time: Time.now,
                                          service_name: "my_app_name",
                                          service_version: "v8"
error_reporting.report error_event
```

### #error_reporting

    def error_reporting(scope: nil, timeout: nil) -> Google::Cloud::ErrorReporting::Project

Create a new object for connecting to the Error Reporting
service. Each call creates a new connection.


<br />

For more information on connecting to Google Cloud see the
[Authentication Guide](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting/latest/AUTHENTICATION "Authentication Guide").
**Parameters**

- **scope** (String, Array\<String\>) *(defaults to: nil)* ---

  The OAuth 2.0 scopes controlling the
  set of resources and operations that the connection can access. See
  [Using OAuth 2.0 to Access Google
  APIs](https://developers.google.com/identity/protocols/OAuth2).

  The default scope is:
  - `https://www.googleapis.com/auth/cloud-platform`
- **timeout** (Integer) *(defaults to: nil)* --- Default timeout to use in requests. Optional.
**Returns**

- ([Google::Cloud::ErrorReporting::Project](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting/latest/Google-Cloud-ErrorReporting-Project))
**Example**

```ruby
require "google/cloud/error_reporting"

gcloud = Google::Cloud.new "GCP_Project_ID",
                           "/path/to/gcp/secretkey.json"
error_reporting = gcloud.error_reporting

error_event = error_reporting.error_event "Error with Backtrace",
                                          event_time: Time.now,
                                          service_name: "my_app_name",
                                          service_version: "v8"
error_reporting.report error_event
```