[racket] What's the idomatic way to handle system call errors?

From: Eric Dong (yd2dong at uwaterloo.ca)
Date: Fri Mar 13 23:10:23 EDT 2015

I suppose this is a non-answer, but it shouldn't be hard at all to write a
"with-error-as-exception" form. I generally believe it's idiomatic to
extend the language whenever something inconvenient, or whenever a
boilerplate "design pattern", comes up.

On Fri, Mar 13, 2015 at 4:27 PM, Jack Firth <jackhfirth at gmail.com> wrote:

> I'm using racket/system to make some calls to other processes, which upon
> failure write to standard error. What's the proper way to handle this? I've
> been using with-output-to-string to get the output, but I don't know how I
> can turn an error response from the external system command into something
> in Racket I can work with. Is there some idiomatic with-error-as-exception
> form or something similar that says "if this thunk writes to standard
> error, throw an exception with the output in the message"?
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150313/e9bdfda7/attachment.html>

Posted on the users mailing list.