wrench-js icon indicating copy to clipboard operation
wrench-js copied to clipboard

copyDirSyncRecursive uses multiple ways to communicate errors

Open oliversalzburg opened this issue 10 years ago • 1 comments

copyDirSyncRecursive both returns and throws errors, depending on where the error happens.

So you'd have to

try {
  var e = wrench.copyDirSyncRecursive();
  if( e ) {
    throw e;
  }
} catch( e ) {
  // Handle error
}

I don't see why this is necessary. throw should be the way to go here.

oliversalzburg avatar May 20 '15 14:05 oliversalzburg

:+1: this bit me please be consistent.

daniel-white avatar Jun 12 '15 15:06 daniel-white