Serialize possible errors