Error handling constants

Error handling constants + Remove obsolete code