pars of error handling moved from tcdefs.h to errors.h