Catch SocketError for LTI

This commit is contained in:
Sebastian Serth
2023-07-13 10:51:47 +02:00
parent 1f25d5e1a3
commit c6977b6319

View File

@ -174,7 +174,7 @@ module Lti
begin
response = provider.post_replace_result!(normalized_lit_score)
{code: response.response_code, message: response.post_response.body, status: response.code_major, score_sent: normalized_lit_score}
rescue IMS::LTI::XMLParseError, Net::OpenTimeout, Net::ReadTimeout, Errno::ECONNRESET
rescue IMS::LTI::XMLParseError, Net::OpenTimeout, Net::ReadTimeout, Errno::ECONNRESET, SocketError
# A parsing error might happen if the LTI provider is down and doesn't return a valid XML response
{status: 'error'}
end