优化错误提示相关代码

This commit is contained in:
GoEdgeLab
2023-08-11 15:26:59 +08:00
parent d2e80ef475
commit 8356622c84
7 changed files with 27 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ package iplibrary
import (
"bytes"
"compress/gzip"
"errors"
"fmt"
"io"
"net"
"os"
@@ -45,7 +45,7 @@ func NewFileDataReader(dataReader io.Reader, password string) (*FileReader, erro
gzReader, err := gzip.NewReader(dataReader)
if err != nil {
return nil, errors.New("create gzip reader failed: " + err.Error())
return nil, fmt.Errorf("create gzip reader failed: %w", err)
}
reader, err := NewReader(gzReader)