go-ora icon indicating copy to clipboard operation
go-ora copied to clipboard

Fix problem caused by not handling error

Open Ranxy opened this issue 1 year ago • 0 comments

During usage, we encountered a Panic error:

error: interface conversion: driver.Rows is nil, not *go_ora.DataSet
runtime.panicdottypeE
    /usr/local/go/src/runtime/iface.go:262
runtime.panicdottypeI
    /usr/local/go/src/runtime/iface.go:272
github.com/sijms/go-ora/v2.(*Connection).QueryRowContext
    /go/pkg/mod/github.com/sijms/go-ora/[email protected]/connection.go:1083
github.com/sijms/go-ora/v2.(*Connection).getDBTimeZone
    /go/pkg/mod/github.com/sijms/go-ora/[email protected]/connection.go:509
github.com/sijms/go-ora/v2.(*Connection).dataTypeNegotiation
    /go/pkg/mod/github.com/sijms/go-ora/[email protected]/connection.go:1289

After investigation, it seems that the issue was caused by not handling the error in the code. Therefore, submitted this PR to resolve the problem and also fixed #564

Ranxy avatar Jun 20 '24 02:06 Ranxy