Exception: SalesforceAdapter::Connection::Errors::SOAPError
- Inherits:
-
Error
- Object
- StandardError
- Error
- SalesforceAdapter::Connection::Errors::SOAPError
show all
- Defined in:
- lib/dm-salesforce-adapter/connection/errors.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of SOAPError.
[View source]
12
13
14
15
|
# File 'lib/dm-salesforce-adapter/connection/errors.rb', line 12
def initialize(message, result)
@result = result
super("#{message}: #{result.inspect}")
end
|
Instance Method Details
permalink
#failed_records ⇒ Object
[View source]
21
22
23
|
# File 'lib/dm-salesforce-adapter/connection/errors.rb', line 21
def failed_records
@result.reject {|r| r.success}
end
|
permalink
#message_for_record(record) ⇒ Object
[View source]
35
36
37
|
# File 'lib/dm-salesforce-adapter/connection/errors.rb', line 35
def message_for_record(record)
record.errors.map {|e| "#{e.statusCode}: #{e.message}"}.join(", ")
end
|
[View source]
17
18
19
|
# File 'lib/dm-salesforce-adapter/connection/errors.rb', line 17
def records
@result.to_a
end
|
permalink
#result_message ⇒ Object
[View source]
29
30
31
32
33
|
# File 'lib/dm-salesforce-adapter/connection/errors.rb', line 29
def result_message
failed_records.map do |r|
message_for_record(r)
end.join("; ")
end
|
permalink
#server_unavailable? ⇒ Boolean
[View source]
39
40
41
42
43
|
# File 'lib/dm-salesforce-adapter/connection/errors.rb', line 39
def server_unavailable?
failed_records.any? do |record|
record.errors.any? {|e| e.statusCode == "SERVER_UNAVAILABLE"}
end
end
|
permalink
#successful_records ⇒ Object
[View source]
25
26
27
|
# File 'lib/dm-salesforce-adapter/connection/errors.rb', line 25
def successful_records
@result.select {|r| r.success}
end
|