Add error handler so we can see what's wrong with a broken SVG file
authorNick Downing <nick@ndcode.org>
Thu, 13 Jan 2022 08:10:31 +0000 (19:10 +1100)
committerNick Downing <nick@ndcode.org>
Thu, 13 Jan 2022 08:10:31 +0000 (19:10 +1100)
MinSVGCache.js

index 011cbd6..414f5e4 100644 (file)
@@ -89,6 +89,8 @@ MinSVGCache.prototype.build = async function(key, result) {
           ]
         }
       )
+      if (render.error)
+        throw new Error(render.error)
       return /*await*/ fs_writeFile(
         temp_pathname,
         render.data,