From aa9e73e42d2527dfecd6f5373f06ca1e4ad7b686 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 15 Mar 2024 10:36:03 +0200 Subject: [PATCH] Return ERROR_UNKNOWN instead of panicing 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 --- pkg/nvml/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/nvml/init.go b/pkg/nvml/init.go index e2bc943..bed2ab4 100644 --- a/pkg/nvml/init.go +++ b/pkg/nvml/init.go @@ -41,7 +41,7 @@ func Shutdown() Return { err := libnvml.close() if err != nil { - panic(err) + return ERROR_UNKNOWN } return ret