[canvaskit] Add catchException everywhere

This should make the logs in the bots more actionable by showing
the error and trace.

This also fixes the API change causing mysterious red.

Bug: skia:
Change-Id: I38df2bb4557041f8bdfefcae5c8d95b58e770033
Reviewed-on: https://skia-review.googlesource.com/c/168180
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/modules/pathkit/tests/pathops.spec.js b/modules/pathkit/tests/pathops.spec.js
index 1453c22..927719a 100644
--- a/modules/pathkit/tests/pathops.spec.js
+++ b/modules/pathkit/tests/pathops.spec.js
@@ -87,16 +87,16 @@
             }).then((_PathKit) => {
                 PathKit = _PathKit;
                 PATHOP_MAP = {
-                    'kIntersect_SkPathOp':PathKit.PathOp.INTERSECT,
-                    'kDifference_SkPathOp':PathKit.PathOp.DIFFERENCE,
-                    'kUnion_SkPathOp': PathKit.PathOp.UNION,
-                    'kXOR_SkPathOp': PathKit.PathOp.XOR,
-                    'kXOR_PathOp': PathKit.PathOp.XOR,
+                    'kIntersect_SkPathOp':         PathKit.PathOp.INTERSECT,
+                    'kDifference_SkPathOp':        PathKit.PathOp.DIFFERENCE,
+                    'kUnion_SkPathOp':             PathKit.PathOp.UNION,
+                    'kXOR_SkPathOp':               PathKit.PathOp.XOR,
+                    'kXOR_PathOp':                 PathKit.PathOp.XOR,
                     'kReverseDifference_SkPathOp': PathKit.PathOp.REVERSE_DIFFERENCE,
                 };
                 FILLTYPE_MAP = {
-                    'kWinding_FillType':PathKit.FillType.WINDING,
-                    'kEvenOdd_FillType':PathKit.FillType.EVENODD,
+                    'kWinding_FillType':        PathKit.FillType.WINDING,
+                    'kEvenOdd_FillType':        PathKit.FillType.EVENODD,
                     'kInverseWinding_FillType': PathKit.FillType.INVERSE_WINDING,
                     'kInverseEvenOdd_FillType': PathKit.FillType.INVERSE_EVENODD,
                 };
@@ -118,11 +118,11 @@
     }
 
     it('combines two paths with .op() and matches what we see from C++', function(done) {
-        LoadPathKit.then(() => {
+        LoadPathKit.then(catchException(done, () => {
             // Test JSON created with:
             // ./out/Clang/pathops_unittest -J ./modules/pathkit/tests/PathOpsOp.json -m PathOpsOp$
             fetch('/base/tests/PathOpsOp.json').then((r) => {
-                r.json().then((json)=>{
+                r.json().then((json) => {
                     expect(json).toBeTruthy();
                     let testNames = Object.keys(json);
                     // Assert we loaded a non-zero amount of tests, i.e. the JSON is valid.
@@ -172,15 +172,15 @@
                     done();
                 });
             });
-        });
+        }));
     });
 
     it('simplifies a path with .simplify() and matches what we see from C++', function(done) {
-        LoadPathKit.then(() => {
+        LoadPathKit.then(catchException(done, () => {
             // Test JSON created with:
             // ./out/Clang/pathops_unittest -J ./modules/pathkit/tests/PathOpsSimplify.json -m PathOpsSimplify$
             fetch('/base/tests/PathOpsSimplify.json').then((r) => {
-                r.json().then((json)=>{
+                r.json().then((json) => {
                     expect(json).toBeTruthy();
                     let testNames = Object.keys(json);
                     // Assert we loaded a non-zero amount of tests, i.e. the JSON is valid.
@@ -225,6 +225,6 @@
                     done();
                 });
             });
-        });
+        }));
     });
 });