pidusage icon indicating copy to clipboard operation
pidusage copied to clipboard

uptime raises unhandled exception if current user has not sufficient privileges with node.js 16.18.0 and newer

Open Gaspode69 opened this issue 3 years ago • 0 comments

API Platform version(s) affected: x.y.z Windows 10, node.js 16.18.0 and newer

Description
uptime raises unhandled exception, so the implemented fallback soultion in wmic.js does not work anymore:

// Fallback on current date when uptime is not allowed (see https://github.com/soyuka/pidusage/pull/130)
const uptime = Math.floor(os.uptime() || (date / 1000))

In older versions of node.js no exception was thrown by os.uptime.

How to reproduce
Try to get uv_uptime with an unpriviledged user

Possible Solution

Additional Context

Gaspode69 avatar Jan 09 '23 16:01 Gaspode69