encode and decode error info from worker processes