mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 20:41:20 +00:00
fix panic handler in NewCompressor (#987)
currently if newdecompressor panics, it will return nil, nil this should make it return an error instead
This commit is contained in:
parent
be83bbc58f
commit
7b16970501
@ -143,13 +143,12 @@ func SetDecompressionTableCondensity(fromBitSize int) {
|
||||
condensePatternTableBitThreshold = fromBitSize
|
||||
}
|
||||
|
||||
func NewDecompressor(compressedFilePath string) (*Decompressor, error) {
|
||||
func NewDecompressor(compressedFilePath string) (d *Decompressor, err error) {
|
||||
_, fName := filepath.Split(compressedFilePath)
|
||||
d := &Decompressor{
|
||||
d = &Decompressor{
|
||||
filePath: compressedFilePath,
|
||||
fileName: fName,
|
||||
}
|
||||
var err error
|
||||
defer func() {
|
||||
if rec := recover(); rec != nil {
|
||||
err = fmt.Errorf("decompressing file: %s, %+v, trace: %s", compressedFilePath, rec, dbg.Stack())
|
||||
|
Loading…
Reference in New Issue
Block a user