lib/dor/services/client/workflow.rb in dor-services-client-0.4.0 vs lib/dor/services/client/workflow.rb in dor-services-client-0.5.0

- old
+ new

@@ -6,16 +6,16 @@ # API calls that are about workflow class Workflow < VersionedService # Begin a new workflow # @param object [String] the pid for the object # @param wf_name [String] the name of the workflow - # @raises [Error] if the request is unsuccessful. + # @raises [UnexpectedResponse] if the request is unsuccessful. # @return nil def create(object:, wf_name:) resp = connection.post do |req| - req.url "#{version}/objects/#{object}/apo_workflows/#{wf_name}" + req.url "#{api_version}/objects/#{object}/apo_workflows/#{wf_name}" end - raise Error, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success? + raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success? end end end end end