Skip to content

Commit 8423336

Browse files
author
nicola
committed
Try catch block should only contain code that throws errors
1 parent 8e3e1bf commit 8423336

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎acl.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ ACL.prototype.readACL = function(pathAcl, pathUri, callback) {
4343
debug("Error parsing ACL policy: " + err.message);
4444
return callback(err);
4545
}
46+
var aclGraph = $rdf.graph();
4647
try {
47-
var aclGraph = $rdf.graph();
4848
$rdf.parse(aclData, aclGraph, pathUri, 'text/turtle');
49-
return callback(null, aclGraph);
5049
} catch (parseErr) {
5150
debug("Error parsing ACL policy: " + parseErr);
5251
return callback(parseErr);
5352
}
53+
54+
return callback(null, aclGraph);
5455
});
5556
};
5657
/**
@@ -389,10 +390,11 @@ ACL.prototype.fetchDocument = function(uri, callback) {
389390
function (body, cb) {
390391
try {
391392
$rdf.parse(body, graph, uri, 'text/turtle');
392-
return cb(null, graph);
393393
} catch(err) {
394394
return cb(err, graph);
395395
}
396+
397+
return cb(null, graph);
396398
}
397399
], callback);
398400
};

0 commit comments

Comments
 (0)