Skip to content

Misleading error for broken symbolic-link on Linux. #29139

@tukkek

Description

@tukkek

Version: Deno 2.2.12.

Reading a broken symbolic-link on Linux fails with Too many levels of symbolic links (a misleading message that could be improved).

#!/usr/bin/env -S deno --allow-read
/*
 * Reproduction steps on Linux:
 * 1. Create `file.txt`.
 * 2. Create a `link.txt` symbolic-link to `file.txt`.
 * 3. Code below works.
 * 4. Delete the original `file.txt`.
 * 5. Run script again.
 *
 * Error: Too many levels of symbolic links (os error 40): readfile 'link.txt'.
 * Expected behavior: a message about a broken-link not "too many links".
 */
let text=await Deno.readTextFile('link.txt')
console.log(text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions