Error Handling¶
Handle errors gracefully with try-catch blocks.
Basic Try-Catch¶
try {
print "Attempting operation...";
throw "Something went wrong!";
print "This won't execute";
} catch err {
print "Error caught: #{err}";
}
print "Program continues";