pyspark.sql.functions.
raise_error
Throws an exception with the provided error message.
Column
A Python string literal or column containing the error message