directly call proc (before execution block) and rescue from an exception if it happens instead of using try, in order to log the error.
This commit is contained in:
@ -168,7 +168,13 @@ class DockerClient
|
|||||||
@container = DockerContainerPool.get_container(@execution_environment)
|
@container = DockerContainerPool.get_container(@execution_environment)
|
||||||
if @container
|
if @container
|
||||||
@container.status = :executing
|
@container.status = :executing
|
||||||
before_execution_block.try(:call)
|
# do not use try here, directly call the passed proc and rescue from the error in order to log the problem.
|
||||||
|
#before_execution_block.try(:call)
|
||||||
|
begin
|
||||||
|
before_execution_block.call
|
||||||
|
rescue StandardError => error
|
||||||
|
Rails.logger.error('execute_websocket_command: Rescued from StandardError caused by before_execution_block.call: ' + error.to_s)
|
||||||
|
end
|
||||||
# TODO: catch exception if socket could not be created
|
# TODO: catch exception if socket could not be created
|
||||||
@socket ||= create_socket(@container)
|
@socket ||= create_socket(@container)
|
||||||
# Newline required to flush
|
# Newline required to flush
|
||||||
|
Reference in New Issue
Block a user