-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Description
The IsFile() function in pkg/typing/types.go (line 94) uses panic() to handle file close errors. This can cause the application to crash when running on network filesystems or container volumes where I/O errors may occur during file.Close(). Users lose all progress with no useful error message.
Location: pkg/typing/types.go:90-96
defer func() {
if err == nil && file != nil {
deferErr := file.Close()
if deferErr != nil {
panic(deferErr)
}
}
}()Suggested Fix
For read-only file handles, close errors can be safely ignored:
defer func() {
if file != nil {
_ = file.Close()
}
}()Related
Similar patterns exist at:
pkg/utils/utils_function.go:46pkg/scenarioorchestrator/utils/utils.go:262
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels