Issue #2731 has been updated by Yusuke Endoh.

Status changed from Open to Rejected

Hi,

2010/2/10 Kornelius Kalnbach <redmine / ruby-lang.org>:
> Trying to copy a file with Ruby:
>
> $ touch source
> $ ls destination
> ls: destination: No such file or directory
> $ ruby -rfileutils -d -e 'FileUtils.copy "source", "destination"'
> Exception `Errno::ENOENT' at /usr/local/lib/ruby/1.9.1/fileutils.rb:1429 - No such file or directory - destination
> $ ls destination
> destination
>
> While the copy succeeds, it prints this confusing message.


You say, library must not use an exception for internal implementation?
The convension is uneasy and too uncomfortable for library authors.

In old convension, an exception might be for exceptional condition.
But currently, it has many use cases not only to represent exceptional
condition but also to represent normal condition (e.g., StopIteration),
to control execution (e.g., DSL), etc.

So this is not a bug and I close the ticket.
Rather, we should reconsider the purpose and behavior of $DEBUG.
Currently, it is worthless in effect.

-- 
Yusuke ENDOH <mame / tsg.ne.jp>
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2731

----------------------------------------
http://redmine.ruby-lang.org