diff --git a/lib/runner/strategy/poseidon.rb b/lib/runner/strategy/poseidon.rb index 4d74d920..a5214059 100644 --- a/lib/runner/strategy/poseidon.rb +++ b/lib/runner/strategy/poseidon.rb @@ -209,7 +209,7 @@ class Runner::Strategy::Poseidon < Runner::Strategy raise Runner::Error::BadRequest.new(response_body[:message]) when 401 raise Runner::Error::Unauthorized.new('Authentication with Poseidon failed') - when 404 + when 410 raise Runner::Error::RunnerNotFound.new when 500 response_body = parse response diff --git a/spec/lib/runner/strategy/poseidon_spec.rb b/spec/lib/runner/strategy/poseidon_spec.rb index f10cbd6e..bdf7fc56 100644 --- a/spec/lib/runner/strategy/poseidon_spec.rb +++ b/spec/lib/runner/strategy/poseidon_spec.rb @@ -57,10 +57,10 @@ describe Runner::Strategy::Poseidon do end end - # All requests except creation handle a NotFound (404) response the same way. - shared_examples 'NotFound (404) error handling' do - context 'when Poseidon returns NotFound (404)' do - let(:response_status) { 404 } + # All runner requests except creation handle a Gone (410) response the same way. + shared_examples 'Gone (410) error handling' do + context 'when Poseidon returns NotFound (410)' do + let(:response_status) { 410 } it 'raises an error' do expect { action.call }.to raise_error(Runner::Error::RunnerNotFound) @@ -293,7 +293,7 @@ describe Runner::Strategy::Poseidon do include_examples 'BadRequest (400) error handling' include_examples 'BadRequest (400) destroys local runner' include_examples 'Unauthorized (401) error handling' - include_examples 'NotFound (404) error handling' + include_examples 'Gone (410) error handling' include_examples 'InternalServerError (500) error handling' include_examples 'unknown response status error handling' include_examples 'Faraday error handling' @@ -316,8 +316,8 @@ describe Runner::Strategy::Poseidon do end end - context 'when Poseidon returns NotFound (404)' do - let(:response_status) { 404 } + context 'when Poseidon returns Gone (410)' do + let(:response_status) { 410 } it 'raises an error' do expect { action.call }.not_to raise_error @@ -357,7 +357,7 @@ describe Runner::Strategy::Poseidon do include_examples 'BadRequest (400) error handling' include_examples 'BadRequest (400) destroys local runner' include_examples 'Unauthorized (401) error handling' - include_examples 'NotFound (404) error handling' + include_examples 'Gone (410) error handling' include_examples 'InternalServerError (500) error handling' include_examples 'unknown response status error handling' include_examples 'Faraday error handling'