as_pkg_metric_error function

A subclass wrapping an error with an additional parent class