You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
@maelfosso When you change your profile picture, the current version of meanjs tries to delete the existing profile picture (pictures are not stored within mongodb, they are stored on the filesystem).
My guess is that, you played with meansjs, you modified some profile picture, then you re-deployed meanjs somewere else on your filesystem (or you deleted altogether the previous install).. but you kept the existing mongodb database.. hence the exception when you are trying to change your profile picture.
If this scenario is indeed what happened, you can fix it by either:
simply adding a default image df9f321cf61c57c89c3e4d0a416e1093.jpg
modify directly your mongodb database, to fix the reference to the missing picture
modify the code of deleteOldImage so that it does not reject the promise on unlink error..
Totally agree with @vaucouleur.
Its not an issue, its just a broken link which is left in MongoDB after you removed the project or reinstalled in a different directory as the resource is not present in the uploads directory.
In the case of a missing file, or bad reference in the User's profileImageUrl field, we probably shouldn't throw an error and send it back to the user.
We should just log the error to the console in the case of when the file isn't found.
We can change the callback logic to something like:
if(unlinkError){console.log(unlinkError);if(unlinkError.code==='ENOENT'){// NO NEED TO RETURN ERROR IN THIS CASEreturnresolve();}reject({message: 'Error occurred while deleting old profile picture'});}else{resolve();}
I'm also skeptical of whether or not we should return any errors from the unlink. It doesn't seem relevant to the User's experience to know if the file was removed. We might just want to silently log any errors here, and then handle it server-side if necessary.
Hi,
Please I always have this error
I don't know why
How could I solve it please ?
Thanks.
The text was updated successfully, but these errors were encountered: