remove use of deprecated to_err_msg