Skip to content

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

@Gaspode69

Description

@Gaspode69

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions