Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 53892f5

Browse files
committed
v3(chore): Replacing references of "abort" with "cancel"
1 parent 6c5f962 commit 53892f5

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/jobs/v3/delete_service_instance_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def send_broker_request(client)
2020
@request_failed = true
2121
raise DeprovisionBadResponse.new(err.message)
2222
rescue CloudController::Errors::ApiError => err
23-
raise OperationAborted.new('The service broker rejected the request') if err.name == 'AsyncServiceInstanceOperationInProgress'
23+
raise OperationCancelled.new('The service broker rejected the request') if err.name == 'AsyncServiceInstanceOperationInProgress'
2424

2525
raise err
2626
end

app/jobs/v3/service_instance_async_job.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module V3
55
class LastOperationStateFailed < StandardError
66
end
77

8-
class OperationAborted < StandardError
8+
class OperationCancelled < StandardError
99
end
1010

1111
class ServiceInstanceAsyncJob < VCAP::CloudController::Jobs::ReoccurringJob
@@ -51,8 +51,8 @@ def perform
5151
fail_and_raise!(err.message) unless restart_on_failure?
5252

5353
restart_job(err.message || 'no error description returned by the broker')
54-
rescue OperationAborted
55-
aborted!(service_instance.last_operation&.type)
54+
rescue OperationCancelled
55+
cancelled!(service_instance.last_operation&.type)
5656
rescue => err
5757
fail!(err)
5858
end
@@ -114,7 +114,7 @@ def raise_if_cannot_proceed!
114114
return if operation_type == 'delete' && last_operation_type == 'create'
115115

116116
if service_instance.operation_in_progress? && last_operation_type != operation_type
117-
aborted!(last_operation_type)
117+
cancelled!(last_operation_type)
118118
end
119119
end
120120

@@ -162,7 +162,7 @@ def record_event(service_instance, request_attrs)
162162
record_service_instance_event(operation_type, service_instance, request_attrs)
163163
end
164164

165-
def aborted!(operation_in_progress)
165+
def cancelled!(operation_in_progress)
166166
raise CloudController::Errors::ApiError.new_from_details('UnableToPerform', operation_type, "#{operation_in_progress} in progress")
167167
end
168168

spec/unit/jobs/v3/delete_service_instance_job_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ module V3
220220
err = CloudController::Errors::ApiError.new_from_details('AsyncServiceInstanceOperationInProgress', 'some instance name')
221221
allow(client).to receive(:deprovision).and_raise(err)
222222

223-
expect { subject.send_broker_request(client) }.to raise_error(OperationAborted, /rejected the request/)
223+
expect { subject.send_broker_request(client) }.to raise_error(OperationCancelled, /rejected the request/)
224224
end
225225
end
226226

0 commit comments

Comments
 (0)