This doesn't look right. Did you mean to change the condition along with the resulting error message? Looks like the new IsString() branch and new throw are unreachable.