The error message should be passed in as an argument.