Skip to content

Commit 9830da2

Browse files
committed
chore(error_handling): Remove unneeded parens
1 parent 774b827 commit 9830da2

File tree

7 files changed

+15
-11
lines changed

7 files changed

+15
-11
lines changed

core/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,23 @@ const patternlab_module = function (config) {
251251

252252
//export patterns if necessary
253253
pattern_exporter.export_patterns(patternlab);
254+
255+
}).catch(reason => {
256+
console.log(reason);
257+
logger.error('Error rendering patterns');
254258
});
255259

256-
}).catch((reason) => {
260+
}).catch(reason => {
257261
console.log(reason);
258262
logger.error('Error rendering pattern lab header');
259263
});
260264

261-
}).catch((reason) => {
265+
}).catch(reason => {
262266
console.log(reason);
263267
logger.error('Error processing meta patterns');
264268
});
265269

266-
}).catch((reason) => {
270+
}).catch(reason => {
267271
console.log(reason);
268272
logger.error('Error in buildPatterns()');
269273
});

core/lib/decompose.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function expandPartials(foundPatternPartials, patternlab, currentPattern) {
5757
currentPattern.extendedTemplate = currentPattern.extendedTemplate.replace(foundPartial, cleanPartialPattern.extendedTemplate);
5858
});
5959
});
60-
}).catch((reason) => {
60+
}).catch(reason => {
6161
logger.error(reason);
6262
});
6363
}
@@ -113,7 +113,7 @@ module.exports = function (pattern, patternlab, ignoreLineage) {
113113
});
114114

115115
return Promise.all([listItemPromise, expandPartialPromise, lineagePromise, addPromise])
116-
.catch((reason) => {
116+
.catch(reason => {
117117
logger.error(reason);
118118
});
119119
};

core/lib/list_item_hunter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const list_item_hunter = function () {
127127
}).catch((reason) => {
128128
logger.error(reason);
129129
});
130-
}).catch((reason) => {
130+
}).catch(reason => {
131131
logger.error(reason);
132132
});
133133
}, Promise.resolve());
@@ -140,7 +140,7 @@ const list_item_hunter = function () {
140140

141141
//update the extendedTemplate in the partials object in case this pattern is consumed later
142142
patternlab.partials[pattern.patternPartial] = pattern.extendedTemplate;
143-
}).catch((reason) => {
143+
}).catch(reason => {
144144
logger.error(reason);
145145
});
146146
});

core/lib/object_factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Pattern.prototype = {
120120
const promise = this.engine.renderPattern(this, data || this.jsonFileData, partials);
121121
return promise.then(results => {
122122
return results;
123-
}).catch((reason) => {
123+
}).catch(reason => {
124124
return Promise.reject(reason);
125125
});
126126
}

core/lib/parameter_hunter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ const parameter_hunter = function () {
320320
patternlab.partials[pattern.patternPartial] = pattern.extendedTemplate;
321321
});
322322
});
323-
}).catch((reason) => {
323+
}).catch(reason => {
324324
logger.error(reason);
325325
});
326326
}, Promise.resolve());

core/lib/processMetaPattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = function (fileName, metaType, patternlab) {
1717
metaPattern.isMetaPattern = true;
1818
return decompose(metaPattern, patternlab, true).then(() => {
1919
patternlab[metaType] = metaPattern.extendedTemplate;
20-
}).catch((reason) => {
20+
}).catch(reason => {
2121
logger.warning(`Could not find the user-editable template ${fileName}, currently configured to be at ${patternlab.config.paths.source.meta}. Your configured path may be incorrect (check paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.`);
2222
logger.warning(reason);
2323
});

core/lib/processRecursive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function (file, patternlab) {
2222

2323
//call our helper method to actually unravel the pattern with any partials
2424
return decompose(currentPattern, patternlab)
25-
.catch((reason)=> {
25+
.catch(reason => {
2626
logger.error(reason);
2727
});
2828
};

0 commit comments

Comments
 (0)