Unpublished
Takes approximately 1 minute to read
Post HistoryMy Experience Learning Python
Throwing Exceptions
In C#, we would have something like:
C#
Skipcode block
if (error) {
throw new Exception("An error occured!");
}
Python
Skipcode block
if error:
raise ValueError("An error occurred.")
Manually raising (throwing) an exception in Python - Stack Overflow