Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor to avoid panic #395

Closed
hangxie opened this issue Jun 14, 2021 · 0 comments
Closed

refactor to avoid panic #395

hangxie opened this issue Jun 14, 2021 · 0 comments

Comments

@hangxie
Copy link
Contributor

hangxie commented Jun 14, 2021

parquet-go as a library should avoid panic so application can decide what to do with exceptions, some panic conditions can be avoided by carefully check data (eg xitongsys/parquet-go-source#31):

$ egrep -r 'recover\(\)|panic\(' *
common/common.go:				panic(err)
common/common.go:				panic(err)
common/common.go:				panic(fmt.Errorf("Unknown repetitiontype: '%v'", val))
common/common.go:				panic(fmt.Errorf("Unknown keyrepetitiontype: '%v'", val))
common/common.go:				panic(fmt.Errorf("Unknown valuerepetitiontype: '%v'", val))
common/common.go:				panic(fmt.Errorf("Unknown encoding type: '%v'", val))
common/common.go:				panic(fmt.Errorf("Unknown keyencoding type: '%v'", val))
common/common.go:				panic(fmt.Errorf("Unknown valueencoding type: '%v'", val))
common/common.go:				panic(fmt.Errorf("Unrecognized tag '%v'", key))
common/common.go:		panic("type " + info.Type + ": " + err.Error())
common/common.go:				panic("logicaltype time error")
common/common.go:				panic("logicaltype time error")
common/common.go:			panic("unknow logicaltype: " + val)
common/common.go:	panic("No known func table in FindFuncTable")
common/common.go:		panic(err)
common/common.go:		panic(err)
layout/rowgroup.go:				if r := recover(); r != nil {
marshal/marshal.go:		if r := recover(); r != nil {
marshal/unmarshal.go:		if r := recover(); r != nil {
marshal/json.go:		if r := recover(); r != nil {
schema/schemahandler.go:		if r := recover(); r != nil {
schema/json.go:		if r := recover(); r != nil {
writer/writer.go:				if r := recover(); r != nil {
writer/writer.go:						panic(errors.New("unsupported data page: " + page.Header.String()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants