@@ -10,7 +10,7 @@ var git = require('../'),
1010 */
1111var RevWalk = function ( rawRepo , rawRevWalk ) {
1212 if ( ! ( rawRepo instanceof git . raw . Repo ) ) {
13- throw git . error ( 'First parameter for RevWalk must be a raw repo' ) ;
13+ throw new git . error ( 'First parameter for RevWalk must be a raw repo' ) ;
1414 }
1515 this . rawRepo = rawRepo ;
1616
@@ -60,7 +60,7 @@ RevWalk.prototype.walk = function(oid, callback) {
6060
6161 self . rawRevWalk . next ( function revWalkNext ( error , oid , walkOver ) {
6262 if ( error ) {
63- callback ( git . error ( error ) , index , commit ) ;
63+ callback ( new git . error ( error . message , error . code ) , index , commit ) ;
6464 return ;
6565 }
6666
@@ -72,7 +72,7 @@ RevWalk.prototype.walk = function(oid, callback) {
7272
7373 ( new git . commit ( self . rawRepo ) ) . lookup ( oid , function revWalkCommitLookup ( error , commit ) {
7474 if ( error ) {
75- callback ( git . error ( error ) , index , commit ) ;
75+ callback ( new git . error ( error . message , error . code ) , index , commit ) ;
7676 return ;
7777 }
7878 if ( callback ( null , index , commit ) === false ) {
0 commit comments