remove use of deprecated to_err_msg
Merge pull request #246 from ebfe/remove-to-err-msg

remove use of deprecated to_err_msg