Sorry to hear that...I would be very sad if I had to watch something happen to my little friend like that.
If this is a frequent occurrence you could get one of these:
That is a pretty high end one, you could get a much cheaper one that should be able to maintain the temp in your fish tank long enough. I use one for my computer (though I would let my fish borrow it if his life depended on it).
It can run my high end computer (around 500 watts), speakers, modem and portable phone for about 45 minutes when the power goes out, so it should be able to run a fishtank for a lot longer.