From 10aa4f99053040b56dd76e9765d9334eed5550ed Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 9 Feb 2021 16:13:18 -0800 Subject: [PATCH] Also log the non-HTTPS URL case in safeImageUrl When I added this new error case in the last change, I made it log to Sentry, because I don't think this should be possible under our data set, so if it happens I want to hear about it. Same is true for this error case, so let's log it too! --- src/app/util.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/util.js b/src/app/util.js index 4eb6e6a..240189b 100644 --- a/src/app/util.js +++ b/src/app/util.js @@ -138,9 +138,11 @@ export function safeImageUrl(urlString) { } if (url.protocol !== "https:") { - console.warn( - `safeImageUrl was provided an unsafe URL, but we don't know how to ` + - `upgrade it to HTTPS: ${urlString}. Returning a placeholder.` + logAndCapture( + new Error( + `safeImageUrl was provided an unsafe URL, but we don't know how to ` + + `upgrade it to HTTPS: ${urlString}. Returning a placeholder.` + ) ); return "https://impress-openneo.net/__error__URL-was-not-HTTPS__"; }