Rescue network-related issues in transmitting LTI scores

Fixes CODEOCEAN-JT
This commit is contained in:
Sebastian Serth
2023-03-14 15:34:28 +01:00
parent 417ead3d3f
commit 5ddad9e83d

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