wren-lang/wren-cli

Completion of error handling

Closed this issue · 3 comments

Would you like to add more error handling for return values from functions like the following?

  • fseek ⇒ readFile

I wouldn't mind handling errors better here. There's still a good bit of work to do in the CLI around handling imports. The current support is pretty rudimentary. (See #4.) When that happens, this code may end up getting rewritten. But, until then, better error handling is always good.

printf ⇒ main

Eh, if Wren can't successfully print the usage info, there's probably not much it could do to recover from that error either. Do you think error handling would be useful here?

  • I suggest to avoid ignorance of return values a bit more.
  • How do you think about to indicate a file output failure by a corresponding exit status for your program?

How do you think about to indicate a file output failure by a corresponding exit status for your program?

Sure, that seems reasonable for code in the CLI.