-
Notifications
You must be signed in to change notification settings - Fork 3.4k
md-icon: Gracefully handle network errors #2530
Comments
Did this occur when using md-svg-icon or md-svg-src (or both)? |
@programmist I was using |
@epelc Thanks for the info and the bug report. |
@programmist No problem let me know if you want me to test anything. |
@epelc Could you verify my fix works for you using this branch? |
Hi, |
Hi @neokeats. Did my branch fix the issue for you? It seems to be working for me. |
Hi,
|
@neokeats Yes, that is a log of the error message returned from the server. But it's not throwing an exception - only logging the error. When I test I don't see all that output, but I'm not using Django - just a plain HTTP server. |
This issue will close when PR #3718 is merged into master. |
It would be nice if
md-icon
gracefully handled network errors. Right now it isn't safe to usemd-icon
if your endpoint is down. It will throw exceptions because it doesn't check certain objects/properties before it uses them.For example the following line isn't safe
material/src/components/icon/iconService.js
Line 357 in 977a495
You can test this by just shutting your server off after you load the first page and go to a second page which has a new icon. It might also be a good idea when this is fixed to implement a missing icon which could be hard coded into the js. This could be used instead if there are any errors loading icons.
Also this hopefully isn't too important on desktop as servers don't go down often(we hope) and you shouldn't be losing your network. But it might be a much larger problem on mobile where your signal constantly goes in and out if your not in a large city.
The text was updated successfully, but these errors were encountered: