Class: Google::Cloud::Logging::AsyncWriteEntriesError

Inherits:
Error
  • Object
show all
Defined in:
lib/google/cloud/logging/errors.rb

Overview

AsyncWriteEntriesError

Used to indicate a problem when AsyncWriter writes log entries to the API. This can occur when the API returns an error.

Examples:

require "google/cloud/logging"
require "google/cloud/error_reporting"

logging = Google::Cloud::Logging.new

resource = logging.resource "gae_app",
                            module_id: "1",
                            version_id: "20150925t173233"

async = logging.async_writer

# Register to be notified when unhandled errors occur.
async.on_error do |error|
  # error can be a AsyncWriteEntriesError, with entries
  Google::Cloud::ErrorReporting.report error
end

logger = async.logger "my_app_log", resource, env: :production
logger.info "Job started."

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, entries = nil) ⇒ AsyncWriteEntriesError

Returns a new instance of AsyncWriteEntriesError.



94
95
96
97
# File 'lib/google/cloud/logging/errors.rb', line 94

def initialize message, entries = nil
  super message
  @entries = entries if entries
end

Instance Attribute Details

#countArray<Google::Cloud::Logging::Entry> (readonly)

objects that were not written to the API due to the error.

Returns:



92
# File 'lib/google/cloud/logging/errors.rb', line 92

attr_reader :entries

#entriesObject (readonly)

Returns the value of attribute entries.



92
93
94
# File 'lib/google/cloud/logging/errors.rb', line 92

def entries
  @entries
end