ng2-avatar
ng2-avatar copied to clipboard
Get a 404 when email not exist in Gravatar
When whe complete the email and name atributtes and the user doues not exists in Gravatar we get a 404 in console, If we what to use this component in a grid we will get a full console with 404 error, can be disabled the 404 response when gravatar not exists?
@lprada Ne this doesn't work because I'm asking for the picture via http. If a 404 is returned, the image will not be displayed. To my knowledge there is no other technical solution.
But make gladly a suggestion how one could solve it?
There is one small technical issue. If you enable Angular global error handler, this 404 will end up there, and there is no good way to ignore it. The only difference is that global error handler will receive "undefined" instead of error object. Are you suggesting put this type of exception into global error handler? I would prefer not to do that... Do you have other suggestions? Maybe this: https://stackoverflow.com/questions/36429903/angular-2-check-if-image-url-is-valid-or-broken? Thanks.
@SergeyBarskiy thanks for the idea but as you say this is not a real solution. But we can talk about it and integrate it if necessary. But I am still missing an argument why it makes sense?
Thanks @lprada and @SergeyBarskiy I am looking forward to your feedback.
@snics First of all, thanks for the control and your response. The only issue I see is that 404 pops up in Angular global error handler. We have one to inform users of the errors that occur in our software. We use ng2-avatar in every app in logged in user area, hence in every app we are getting an error in global error handler as soon as user logs in. Essentially, it is harmless issue except error logging, which is important to us. I hope this clarifies things. Thanks again.