瀏覽代碼

don't throw string

Michael Wang 3 年之前
父節點
當前提交
55f3c0a4b1
共有 1 個文件被更改,包括 2 次插入2 次删除
  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(