Skip to content

empty-catch: sdks/typescript/pmxt/server-manager.ts:381 — completely empty catch block for lock file removal #940

@realfishsam

Description

@realfishsam

Violation

// Remove lock file (best effort)
try {
    const { unlinkSync } = await import('fs');
    unlinkSync(this.lockPath);
} catch { }

Location

sdks/typescript/pmxt/server-manager.ts:381

Why It Matters

This is a fully empty catch {} with no comment, no log, and no action. While "best effort" lock removal is intentional, a completely silent catch makes it impossible to distinguish expected failures (file already gone) from unexpected ones (permission denied, wrong path, FS error). A permission error here would leave a stale lock file that blocks the next server start — with zero diagnostic output.

Suggested Fix

} catch (err) {
    // Best-effort — expected when file was already removed
    logger.debug('server-manager: lock file removal failed', { path: this.lockPath, error: String(err) });
}

Found by automated code hygiene audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions