Modify NotSupportedException to ValueError