Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make read on a FsFile without { read: true } error message clearer #27497

Open
CyanChanges opened this issue Dec 30, 2024 · 0 comments
Open

Make read on a FsFile without { read: true } error message clearer #27497

CyanChanges opened this issue Dec 30, 2024 · 0 comments

Comments

@CyanChanges
Copy link

Open a file without specify { read: true }

import { toText } from 'jsr:@std/streams'
const file = await Deno.open('log-1.json', { append: true })
const lines = await toText(file.readable)

Result in error:

error: Uncaught (in promise) Error: Bad file descriptor (os error 9)
    at async Object.pull (ext:deno_web/06_streams.js:941:27)

In this case, instead of Bad file descriptor (os error 9) , FsFile is not readable should be more clear.

This is just an example.
I can't just use Deno.readTextFile(...) instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant