mirror of
https://github.com/feathericons/feather.git
synced 2023-08-10 21:13:24 +03:00
refactor(replace): Replace console.error
with throw new Error
This commit is contained in:
parent
0d342b33a5
commit
3a3df71e3f
@ -32,13 +32,11 @@ function replaceElement(element, options) {
|
|||||||
const key = element.getAttribute('data-feather');
|
const key = element.getAttribute('data-feather');
|
||||||
|
|
||||||
if (!key) {
|
if (!key) {
|
||||||
console.error('The required `data-feather` attribute has no value.');
|
throw new Error('The required `data-feather` attribute has no value.');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!icons[key]) {
|
if (!icons[key]) {
|
||||||
console.error(`No icon matching '${key}'. See the complete list of icons at https://feathericons.com`);
|
throw new Error(`No icon matching '${key}'. See the complete list of icons at https://feathericons.com`);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const elementClassAttr = element.getAttribute('class') || '';
|
const elementClassAttr = element.getAttribute('class') || '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user