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

Missing error mechanism for StdStream #4258

Closed
pcrockett opened this issue Nov 24, 2022 · 1 comment
Closed

Missing error mechanism for StdStream #4258

pcrockett opened this issue Nov 24, 2022 · 1 comment

Comments

@pcrockett
Copy link

I have a standard hello world program that I'm using to start learning the language, and I'm trying to introduce an error by redirecting the output to a device that doesn't have any free space:

./hello-pony > /dev/full

(Inspired by https://blog.sunfishcode.online/bugs-in-hello-world/)

This (and other similar scenarios) should cause an error, however I see no way to detect it. Looking at the implementation of StdStream.flush() I see this comment:

  """
  Flush any data out to the os (ignoring failures).
  """

This seems like an important gap in the builtin library.

For what it's worth, from a non-Pony developer's perspective, the FileStream error mechanism (requiring a person to check File.errno()) seems less than ideal as well. Maybe that's just a difference in style / preference.

I'd follow the RFP process to suggest a general error mechanism for OutStream, but I'm afraid I don't have the bandwidth for that right now. Apologies.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Nov 24, 2022
@SeanTAllen
Copy link
Member

Thanks. I'm closing this in favor of ponylang/rfcs#205.

@ponylang-main ponylang-main added discuss during sync Should be discussed during an upcoming sync and removed discuss during sync Should be discussed during an upcoming sync labels Nov 24, 2022
@SeanTAllen SeanTAllen removed the discuss during sync Should be discussed during an upcoming sync label Feb 14, 2023
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

3 participants