26-2-401. Right of witness to protection from harassment. It is the right of a witness to be protected from irrelevant, improper, or insulting questions and from harsh or insulting demeanor; to be detained only so long as the interests of justice require it; to be examined only as to matters legal and pertinent to the issue.