try {
undefinedFn()
} catch (err) {
console.log(err)
}
def hello
puts "Hello, World!"
# start an exception handler
begin
raise "This is an exception"
rescue => e
puts "Exception caught: #{e}"
end
end
hello
raise "oops, something went wrong"
catch [throw 22 print "You'll never see this."]
try/except [read %does_not_exist] [print "File not found"]
catch [throw 22 print "You'll never see this."]
if error? try [read %does_not_exist] [print "File not found"]
Languages with Exceptions include Java, JavaScript, C++, PHP, C#, Ruby, Scala, Swift, Kotlin, PowerShell, TypeScript, Elixir, Dart, Solidity, CoffeeScript, Groovy, ABAP, REBOL, X10, Pizza, Apex, Boron, Sophia, Deesel, Real-Time Concurrent C, Static Typescript
Languages without Exceptions include C, Objective-C, progsbase, Tick C, cooC
Read more about Exceptions on the web: 1.
HTML of this page generated by Features.ts