From e8ad1a4a4b26d767b27096e0e82c6e6b602c9389 Mon Sep 17 00:00:00 2001 From: FelisCatus Date: Sun, 26 Feb 2017 20:46:25 -0500 Subject: [PATCH] Log error when drawing icon once for debugging. --- omega-target-chromium-extension/background.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/omega-target-chromium-extension/background.coffee b/omega-target-chromium-extension/background.coffee index fa44620..8fc9645 100644 --- a/omega-target-chromium-extension/background.coffee +++ b/omega-target-chromium-extension/background.coffee @@ -29,6 +29,7 @@ Promise.onUnhandledRejectionHandled (promise) -> iconCache = {} drawContext = null +drawError = null drawIcon = (resultColor, profileColor) -> cacheKey = "omega+#{resultColor ? ''}+#{profileColor}" icon = iconCache[cacheKey] @@ -47,7 +48,10 @@ drawIcon = (resultColor, profileColor) -> drawOmega drawContext, profileColor drawContext.setTransform(1, 0, 0, 1, 0, 0) icon[size] = drawContext.getImageData(0, 0, size, size) - catch + catch e + if not drawError? + drawError = e + Log.error(e) icon = null return iconCache[cacheKey] = icon