I lost connection for a few seconds during raids a few times, but connection was back before I reached the castle gate, and meanwhile the attack was going on as usual, no problems there.
For connection lost at the end of the raid, I mostly see a “bad connection” warning overlayed on the victory/end-of-raid screen for about 10-15 sec during which the game tries to find connection again, and if that is not successful, then it will move on to the “connection lost” screen with the intro/loading background. Sometimes I then get the rewards earned so far, sometimes I just lost that and trophies like in a 0%-attack (especially in the last week).
When player A attacks player B (B being offline at that time), the maximum loot (ML) that A can gain through his attack by a 100% victory is deducted from B’s gold and “reserved”. When A fails to get a 100% victory, part of the reserved gold is given back to B. When in the meanwhile B comes online, he’ll see the lowered gold amount, as well as an additional symbol (a pair of swords if I recall correctly), right next to his gold display and the “add gold-shield” symbol, on the left top of the screen. When clicking that additional symbol, the queen tells B that someone currently tries to steal ML gold from them. If A gets less than 100%, at the end of the raid, B will get a popup window saying “we could save [some amount between 0 and ML] gold”, and B’s gold display will increase again.
So, when B comes online while A is raiding B, A can continue as if B were still offline. If A gets a connection lost, but is able to reconnect within a short time span, why not let B continue the raid either?
Also, for pausing, there is a time limit - once I had to pause a raid several times and during one of the pauses (after maybe half a minute or so?) the end of raid screen appeared, as if the raiding time was over - so, maybe a similar time limit could be applied to resuming an interrupted raid.
Though, I guess it could be problematic to recover the whole current state of a raid after an interruption. As you can raid someone with constant but very slow internet connection, I guess only a limited amount of status data gets actually synched with the server?