Measures Concepts
GitHub icon

Exceptions

Exceptions - language feature

< >
Example from JavaScript, TypeScript:
try { undefinedFn() } catch (err) { console.log(err) }
Example from Ruby:
def hello puts "Hello, World!" # start an exception handler begin raise "This is an exception" rescue => e puts "Exception caught: #{e}" end end hello
Example from Elixir:
raise "oops, something went wrong"
Example from REBOL:
catch [throw 22 print "You'll never see this."] try/except [read %does_not_exist] [print "File not found"]
Example from Aardvark:
Has throw, try, and catch
Example from Boron:
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, Ruby, C#, Swift, Scala, Kotlin, PowerShell, TypeScript, Elixir, Dart, Solidity, CoffeeScript, Groovy, ABAP, REBOL, X10, Pizza, Apex, Aardvark, Boron, Sophia, Oracle Java, Deesel, Real-Time Concurrent C

Languages without Exceptions include C, Objective-C, Speedie, progsbase, Tick C

This question asks: Does the language have a concept and syntax for exceptions?

Read more about Exceptions on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Day 605 feedback@pldb.io Logout