Normally, nothing should be thrown during encoding, or else you have designed your application to fail to send some of your messages. I think that is an error.