Raise

Hello
Wouldnt it be much cleaner if raise wrote to $stderr (instead $stdout) ?

Berg

raise doesn't write anywhere; an unrescued exception that reaches the top
level is displayed by some part of the core machinery.

If you catch all your exceptions, you can write them wherever you want.

Cheers

···

On 21 April 2016 at 09:19, A Berger <aberger7890@gmail.com> wrote:

Hello
Wouldnt it be much cleaner if raise wrote to $stderr (instead $stdout) ?

Berg

--
  Matthew Kerwin
  http://matthew.kerwin.net.au/

Hello,
Yes I meant that - top level exception-handler(s) should write to stderr...
$stderr should be the default for (all) exceptions, shouldnt it?

Berg

···

Am 21.04.2016 01:58 schrieb "Matthew Kerwin" <matthew@kerwin.net.au>:

On 21 April 2016 at 09:19, A Berger <aberger7890@gmail.com> wrote:

Hello
Wouldnt it be much cleaner if raise wrote to $stderr (instead $stdout) ?

Berg

raise doesn't write anywhere; an unrescued exception that reaches the top
level is displayed by some part of the core machinery.

If you catch all your exceptions, you can write them wherever you want.

Cheers
--
  Matthew Kerwin
  http://matthew.kerwin.net.au/

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Exceptions shouldn't reach the top level. But regarding your complaint...
they do go to stderr:

···

On 21 April 2016 at 11:35, A Berger <aberger7890@gmail.com> wrote:

Hello,
Yes I meant that - top level exception-handler(s) should write to stderr...
$stderr should be the default for (all) exceptions, shouldnt it?

Berg

~~~
$ ruby -e 'raise' > /dev/null
-e:1:in `<main>': unhandled exception
$ ruby -e 'raise' 2> /dev/null
$
~~~

​Cheers
--
  Matthew Kerwin
  http://matthew.kerwin.net.au/

Hi
It took a time to reconstruct the test-case: it was irb. In irb Exceptions
go to stdout.
Maybe it makes sense to not use stderr in irb...
Berg

···

Am 21.04.2016 04:42 schrieb "Matthew Kerwin" <matthew@kerwin.net.au>:

On 21 April 2016 at 11:35, A Berger <aberger7890@gmail.com> wrote:

Hello,
Yes I meant that - top level exception-handler(s) should write to
stderr...
$stderr should be the default for (all) exceptions, shouldnt it?

Berg

Exceptions shouldn't reach the top level. But regarding your complaint...
they do go to stderr:

~~~
$ ruby -e 'raise' > /dev/null
-e:1:in `<main>': unhandled exception
$ ruby -e 'raise' 2> /dev/null
$
~~~

​Cheers
--
  Matthew Kerwin
  http://matthew.kerwin.net.au/

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;