Standardize error messages in R.