Exception: Restforce::DB::SynchronizationError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Restforce::DB::SynchronizationError
- Extended by:
- Forwardable
- Defined in:
- lib/restforce/db/synchronization_error.rb
Overview
Restforce::DB::SynchronizationError is a thin wrapper for any sort of exception that might crop up during our record synchronization. It exposes the Salesforce ID (or database identifier, for unsynced records) of the record which triggered the exception.
Instance Attribute Summary collapse
-
#base_exception ⇒ Object
readonly
Returns the value of attribute base_exception.
Instance Method Summary collapse
-
#initialize(base_exception, instance) ⇒ SynchronizationError
constructor
Public: Initialize a new SynchronizationError.
-
#message ⇒ Object
Public: Get the message for this exception.
Constructor Details
#initialize(base_exception, instance) ⇒ SynchronizationError
Public: Initialize a new SynchronizationError.
base_exception - An exception which should be logged. instance - A Restforce::DB::Instances::Base representing a record.
24 25 26 27 |
# File 'lib/restforce/db/synchronization_error.rb', line 24 def initialize(base_exception, instance) @base_exception = base_exception @instance = instance end |
Instance Attribute Details
#base_exception ⇒ Object (readonly)
Returns the value of attribute base_exception.
11 12 13 |
# File 'lib/restforce/db/synchronization_error.rb', line 11 def base_exception @base_exception end |
Instance Method Details
#message ⇒ Object
Public: Get the message for this exception. Prepends the Salesforce ID.
Returns a String.
32 33 34 35 36 37 38 39 40 |
# File 'lib/restforce/db/synchronization_error.rb', line 32 def debug_info = [ @instance.mapping.database_model, @instance.mapping.salesforce_model, @instance.id, ] "[#{debug_info.join('|')}] #{base_exception.}" end |