Return an error for invalid priority.