mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-10 04:51: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
|
condensePatternTableBitThreshold = fromBitSize
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDecompressor(compressedFilePath string) (*Decompressor, error) {
|
func NewDecompressor(compressedFilePath string) (d *Decompressor, err error) {
|
||||||
_, fName := filepath.Split(compressedFilePath)
|
_, fName := filepath.Split(compressedFilePath)
|
||||||
d := &Decompressor{
|
d = &Decompressor{
|
||||||
filePath: compressedFilePath,
|
filePath: compressedFilePath,
|
||||||
fileName: fName,
|
fileName: fName,
|
||||||
}
|
}
|
||||||
var err error
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if rec := recover(); rec != nil {
|
if rec := recover(); rec != nil {
|
||||||
err = fmt.Errorf("decompressing file: %s, %+v, trace: %s", compressedFilePath, rec, dbg.Stack())
|
err = fmt.Errorf("decompressing file: %s, %+v, trace: %s", compressedFilePath, rec, dbg.Stack())
|
||||||
|
Loading…
Reference in New Issue
Block a user