add error type to global var, update errormetrics