copyDirSyncRecursive uses multiple ways to communicate errors #103

Open
opened 2015-05-20 07:42:45 -07:00 by oliversalzburg · 1 comment
oliversalzburg commented 2015-05-20 07:42:45 -07:00 (Migrated from github.com)

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.

`copyDirSyncRecursive` both _returns_ and _throws_ errors, depending on where the error happens. So you'd have to ``` js 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.
daniel-white commented 2015-06-12 08:33:29 -07:00 (Migrated from github.com)

👍 this bit me please be consistent.

:+1: this bit me please be consistent.
This repository is archived. You cannot comment on issues.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/wrench-js#103
No description provided.