Add decode/encode error logging