The state or its political subdivisions shall not be liable for any claim based upon the exercise or performance, or the failure to exercise or perform, a discretionary function or duty on the part of a state or local agency or any employee of the state or its political subdivisions in carrying out the provisions of this chapter.