Browse Source

don't throw string

Michael Wang 3 years ago
parent
commit
55f3c0a4b1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/utils/utils.ts

+ 2 - 2
src/utils/utils.ts

@@ -68,7 +68,7 @@ export async function getDataUrlForSliceConfig(
   const ctx = canvas.getContext("2d");
   if (!ctx) {
     console.log('canvas.getContext("2d") error');
-    throw "canvas ctx error";
+    throw new Error("canvas ctx error");
   }
   // drawImage 画图软件透明色
   ctx.drawImage(
@@ -140,7 +140,7 @@ export async function getDataUrlForSplitConfig(
   const ctx = canvas.getContext("2d");
   if (!ctx) {
     console.log('canvas.getContext("2d") error');
-    throw "canvas ctx error";
+    throw new Error("canvas ctx error");
   }
   // drawImage 画图软件透明色
   ctx.drawImage(