Log serialisation errors instead of e.printStackTrace().