From 5997b29ceec93020fca93621aeee32acfb23c4c3 Mon Sep 17 00:00:00 2001 From: David Joy Date: Mon, 15 May 2023 17:01:15 -0400 Subject: [PATCH] fix: logging an error when unit iframe fails to load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Right now we log nothing to the logging service when a unit iframe fails to load. The ErrorPage that’s shown isn’t using the ErrorBoundary, so we had no indication that something went wrong. This solves the problem closer to the source where the error originates. --- src/courseware/course/sequence/Unit.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/courseware/course/sequence/Unit.jsx b/src/courseware/course/sequence/Unit.jsx index 57ca1899..58f680ed 100644 --- a/src/courseware/course/sequence/Unit.jsx +++ b/src/courseware/course/sequence/Unit.jsx @@ -251,6 +251,9 @@ const Unit = ({ // could have given us a 4xx or 5xx response. if (!hasLoaded) { setShowError(true); + logError('Unit iframe failed to load. Server possibly returned 4xx or 5xx response.', { + iframeUrl, + }); } window.onmessage = (e) => {