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:

committed by
Sebastian Serth

parent
5e913c8a1a
commit
d5b274c9f2
3
app/errors/runner/error.rb
Normal file
3
app/errors/runner/error.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error < ApplicationError; end
|
3
app/errors/runner/error/bad_request.rb
Normal file
3
app/errors/runner/error/bad_request.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error::BadRequest < Runner::Error; end
|
3
app/errors/runner/error/execution_timeout.rb
Normal file
3
app/errors/runner/error/execution_timeout.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error::ExecutionTimeout < Runner::Error; end
|
3
app/errors/runner/error/internal_server_error.rb
Normal file
3
app/errors/runner/error/internal_server_error.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error::InternalServerError < Runner::Error; end
|
3
app/errors/runner/error/not_available.rb
Normal file
3
app/errors/runner/error/not_available.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error::NotAvailable < Runner::Error; end
|
3
app/errors/runner/error/not_found.rb
Normal file
3
app/errors/runner/error/not_found.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error::NotFound < Runner::Error; end
|
3
app/errors/runner/error/unauthorized.rb
Normal file
3
app/errors/runner/error/unauthorized.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error::Unauthorized < Runner::Error; end
|
3
app/errors/runner/error/unknown.rb
Normal file
3
app/errors/runner/error/unknown.rb
Normal file
@ -0,0 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Runner::Error::Unknown < Runner::Error; end
|
@ -1,4 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RunnerNotAvailableError < ApplicationError
|
||||
end
|
Reference in New Issue
Block a user