Skip to content

Commit

Permalink
Return ERROR_UNKNOWN instead of panicing
Browse files Browse the repository at this point in the history
This change removes the panic from the shutdown code. Instead
an ERROR_UNKNOWN is returned. This does cause the source of the error
to be lost, but this can be addressed in a follow-up.

Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Mar 15, 2024
1 parent 20c256c commit 929b0ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gen/nvml/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Shutdown() Return {

err := libnvml.close()
if err != nil {
panic(err)
return ERROR_UNKNOWN
}

return ret
Expand Down
2 changes: 1 addition & 1 deletion pkg/nvml/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Shutdown() Return {

err := libnvml.close()
if err != nil {
panic(err)
return ERROR_UNKNOWN
}

return ret
Expand Down

0 comments on commit 929b0ca

Please sign in to comment.