This has happened to me twice now, both times during finals week. I wake up in the early morning (5am and 3am) and feel terrible, I go to the bathroom, and then I feel like I'm going to throw up. My head feels funny and I cant breath. Last time this happened I lost my vision and ended up with a concussion. I felt the exact same way last night. Could this be a panic attack of sorts?
Without more information other than the common factor of finals week, I'd suspect it is a combination of too much caffeine or other stimulant for studying, too little sleep, and stress. You don't mention whether you are experiencing rapid heart rate when this occurs. it seems more like a vasovagal reaction from an upset stomach lining (gastritis) brought on by too much acid, brought on by too much of everything I mentioned above.
it certain might be wise to get things checked out if this is continuing to be a pattern--we do lab work, an examination, possibly an EKG and maybe consider some medication.