Skip to content

Commit

Permalink
sensors init: check err during init
Browse files Browse the repository at this point in the history
  • Loading branch information
inv2004 committed Jan 23, 2023
1 parent c098b67 commit 068f966
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ttop/procfs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ proc initSensors*() =
try:
sensors.init()
sensorsEnabled = true
except LibraryError:
except LibraryError, SensorsException:
discard

proc init*() =
Expand Down Expand Up @@ -367,7 +367,8 @@ proc netInfo(): OrderedTableRef[string, Net] =

proc tempInfo(): Temp =
if sensorsEnabled:
result.cpu = try: some(sensors.cpuMaxTemp()) except KeyError, ValueError: none(float64)
result.cpu = try: some(sensors.cpuMaxTemp()) except KeyError,
ValueError: none(float64)
result.nvme = try: some(sensors.nvmeMaxTemp()) except KeyError,
ValueError: none(float64)

Expand Down

0 comments on commit 068f966

Please sign in to comment.