getErrorMsg and printErr