Skip to content

Commit

Permalink
Move default exception to end
Browse files Browse the repository at this point in the history
  • Loading branch information
bethune-bryant committed Jul 29, 2024
1 parent ca650ba commit 5b229f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gpustat/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,12 @@ def _wrapped(*args, **kwargs):
handle: NVMLHandle = N.nvmlDeviceGetHandleByIndex(index)
gpu_info = get_gpu_info(handle)
gpu_stat = GPUStat(gpu_info)
except Exception as e:
gpu_stat = InvalidGPU(index, "((Unknown Error))", e)
except N.NVMLError_Unknown as e:
gpu_stat = InvalidGPU(index, "((Unknown Error))", e)
except N.NVMLError_GpuIsLost as e:
gpu_stat = InvalidGPU(index, "((GPU is lost))", e)
except Exception as e:
gpu_stat = InvalidGPU(index, "((Unknown Error))", e)

if isinstance(gpu_stat, InvalidGPU):
log.add_exception("GPU %d" % index, gpu_stat.exception)
Expand Down

0 comments on commit 5b229f8

Please sign in to comment.