My stomach always hurts when I am upset, worried, stressed, anxious, whatever........
Maybe try doing some reading on nutrition. You could be eating things that are making your stomach hurt. Try some dietary changes to see if that helps. Like eliminating certain items and then re-introducing to see if that particular food is causing the gas, bloating, etc.
Try not to worry so much. That makes everyone feel unwell.
Gem