Exception handling for cosm