error handling on cosm send routine