Skip to content

Commit

Permalink
fix: logging an error when unit iframe fails to load
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidjoy committed May 16, 2023
1 parent d2de063 commit 5997b29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/courseware/course/sequence/Unit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 5997b29

Please sign in to comment.