Ensure that exceptions are serializable