Skip to content

empty-catch: sdks/typescript/pmxt/ws-client.ts:345 — WebSocket close error silently ignored #942

@realfishsam

Description

@realfishsam

Violation

try {
    this.ws.close();
} catch {
    // ignore
}

Location

sdks/typescript/pmxt/ws-client.ts:345 (inside SidecarWsClient.close())

Why It Matters

The catch block contains only a comment and performs no action. While ignoring close() errors during teardown is often intentional, completely suppressing the exception hides unexpected errors that are not related to normal close-race conditions. A debug-level log costs nothing and makes teardown diagnostics possible.

Suggested Fix

} catch (err) {
    logger.debug('[SidecarWsClient] error during ws.close()', { error: String(err) });
}

Found by automated code hygiene audit

Metadata

Metadata

Assignees

No one assigned

    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