Browse Source

enhance: repalce zip error with difypkg

Yeuoly 9 months ago
parent
commit
32fa5a91d6
1 changed files with 3 additions and 0 deletions
  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,