From: Kornelius Kalnbach Date: 2010-04-12T02:33:41+09:00 Subject: [ruby-core:29453] Re: [Bug #2731](Rejected) FileUtils.copy prints error message in $DEBUG mode when destination doesn't exist On 11.04.10 16:08, Yusuke Endoh wrote: > 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. You're right. I agree that it's not a bug, more like an inconvenient behavior. The patch might still be an improvement. The only workaround I know is: debug, $DEBUG = $DEBUG, false FileUtils.copy source, destination $DEBUG = debug I don't like such constructs because they look ugly (aka "noise"). > 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. Spontaneous idea: Setting $DEBUG to an Exception class or an array of such classes to specify which exception you want to debug. Improving Rubys debugging capabilities can't hurt. [murphy]