Skip to content

Commit 3a3df71

Browse files
committed
refactor(replace): Replace console.error with throw new Error
1 parent 0d342b3 commit 3a3df71

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/replace.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ function replaceElement(element, options) {
3232
const key = element.getAttribute('data-feather');
3333

3434
if (!key) {
35-
console.error('The required `data-feather` attribute has no value.');
36-
return;
35+
throw new Error('The required `data-feather` attribute has no value.');
3736
}
3837

3938
if (!icons[key]) {
40-
console.error(`No icon matching '${key}'. See the complete list of icons at https://feathericons.com`);
41-
return;
39+
throw new Error(`No icon matching '${key}'. See the complete list of icons at https://feathericons.com`);
4240
}
4341

4442
const elementClassAttr = element.getAttribute('class') || '';

0 commit comments

Comments
 (0)