Correct exceptions

Look at the motivation for each commit. I am a bit unsure of replacing "raise Exception" but I didn't want to hijack WebSocket's exceptions nor create my own.