Sometimes all we can do is have a postive intention to keep a promise. Sounds like you did have a postive intention, but the situation you were in was just too challenging for you to not use something to help you cope that you have used in the past.
For me the self critical stuff just makes the urges worse, so try and be kind to yourself, sounds like you tried really hard.