Introduce new error types for runners

The errors are raised in the runner model and in the runner connection
class. In the submission controller the errors are rescued and,
depending on the error, the status timeout / container depleted is
sent to the client.
This commit is contained in:
Felix Auringer
2021-05-27 10:21:25 +02:00
committed by Sebastian Serth
parent 5e913c8a1a
commit d5b274c9f2
12 changed files with 137 additions and 53 deletions

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error < ApplicationError; end

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error::BadRequest < Runner::Error; end

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error::ExecutionTimeout < Runner::Error; end

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error::InternalServerError < Runner::Error; end

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error::NotAvailable < Runner::Error; end

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error::NotFound < Runner::Error; end

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error::Unauthorized < Runner::Error; end

View File

@ -0,0 +1,3 @@
# frozen_string_literal: true
class Runner::Error::Unknown < Runner::Error; end

View File

@ -1,4 +0,0 @@
# frozen_string_literal: true
class RunnerNotAvailableError < ApplicationError
end