Rescue network-related issues in transmitting LTI scores

Fixes CODEOCEAN-JS
This commit is contained in:
Sebastian Serth
2023-03-15 13:05:37 +01:00
parent fe90a7fb65
commit 6d3587e813

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
rescue IMS::LTI::XMLParseError, Net::OpenTimeout, Net::ReadTimeout, Errno::ECONNRESET
# A parsing error might happen if the LTI provider is down and doesn't return a valid XML response
{status: 'error'}
end