I think the serializer should be responsible for handling its own error conditions, and the bare except should be limited to catching the exceptions that might happen trying to turn the cookie value into bytes.