I understand the way you feel i really do, it's hard i know cos there is no quick fixes where depression is concerned and even one day of emotional pain can feel way too much.
We all make some mistakes that's part of being human, it doesn't make you any worse than me or anyone else for that matter. Being a parent is hard especially when you have depression etc, your family surely understand that. We can't change the past, only what we do now-what about writing your sons a letter and explaining to them how you feel about things and that you would love to be able to reconnect with them in someway.
Try not to dwell on things that you feel you've failed with,i know it's easier said than done but sometimes others may see things differently to how we perceive them because we feel depressed and can't think anything positive about ourselves. Take care and don't suffer alone with these feelings, you deserve to feel better we all do.