"E:failed to mount" on Samsung Galaxy J5 after factory reset
your phone may be damaged now, So, I think that You have to install Stock ROM again. your phone will not avoid warranty. Stock Rom is default and official Rom.

But, some cases, do not we want to install Stock ROM again .. If we can force reset Samsung phone. Then it will settle. So you had better try to reset from PC before flashing ..