jenkins-bot has submitted this change and it was merged.

Change subject: Latexer should not die on a bad image
......................................................................


Latexer should not die on a bad image

Sometimes the conversions fail because the images are corrupted. Catch
the error, report it, and continue on.

Change-Id: Icc82743671f6c4e2dfb06695d2a882eb05391e04
---
M lib/index.js
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Cscott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/index.js b/lib/index.js
index 287c79c..a7fc2b7 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -947,8 +947,8 @@
        resource = url.resolve(this.base, img.getAttribute('resource'));
        filename = this.options.imagemap.get(resource);
        if (!filename) {
-               // couldn't download this image.
-               console.error('Skipping', resource, '(download)');
+               // couldn't download or convert this image.
+               console.error('Skipping', resource, '(download/convert)');
                return;
        }
        if (/[.](svg|gif|ogg|ogv)$/i.test(filename)) { // skip some fmts
@@ -1295,6 +1295,11 @@
                // record the final filename
                pp = pp.then(function(info) {
                        imagemap.set(key, info.filename);
+               }, function(err) {
+                       console.error(
+                               "Could not convert image '%s': %s (%s)",
+                               val.filename, val.short, err
+                       );
                });
                p = Promise.join(p, pp); // serialize completion
        }).then(function() {

-- 
To view, visit https://gerrit.wikimedia.org/r/148614
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc82743671f6c4e2dfb06695d2a882eb05391e04
Gerrit-PatchSet: 5
Gerrit-Project: 
mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
Gerrit-Branch: master
Gerrit-Owner: Mwalker <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to