浏览代码

enhance: repalce zip error with difypkg

Yeuoly 9 月之前
父节点
当前提交
32fa5a91d6
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      internal/core/plugin_packager/decoder/zip.go

+ 3 - 0
internal/core/plugin_packager/decoder/zip.go

@@ -29,6 +29,9 @@ type ZipPluginDecoder struct {
 
 func NewZipPluginDecoder(binary []byte) (*ZipPluginDecoder, error) {
 	reader, err := zip.NewReader(bytes.NewReader(binary), int64(len(binary)))
+	if err != nil {
+		return nil, errors.New(strings.ReplaceAll(err.Error(), "zip", "difypkg"))
+	}
 
 	decoder := &ZipPluginDecoder{
 		reader: reader,