pocketsize / bolts-wp

A starter theme for WordPress using Bolts
2 stars 0 forks source link

Consider not throwing an exception in get_svg for missing assets #41

Closed andreekeberg closed 5 years ago

andreekeberg commented 5 years ago

It's a bit harsh to completely stop execution because a compiled asset is missing, making it hard to develop back-end related parts without necessarily having the latest compiled assets.

Also, we should probably only throw exceptions that we can actually catch, and since we only use get_svg in components, where we don't want the kind of logic that try...catch blocks are, that's another reason to not use this here.

I think the best solution is to simply fail silently by returning false.

andreekeberg commented 5 years ago

Fixed in #48