Top 1,000 Features Creators Resources Extensions Blog Explorer CSV Download
GitHub icon

Exceptions

< >
Example from 1 languages: JavaScript
try { undefinedFn() } catch (err) { console.log(err) }
Example from 1 languages: 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 1 languages: Elixir
raise "oops, something went wrong"
Example from 1 languages: REBOL
catch [throw 22 print "You'll never see this."] try/except [read %does_not_exist] [print "File not found"]
Example from 1 languages: Aardvark
Has throw, try, and catch
Example from 1 languages: 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 JavaScript, Java, C++, Ruby, PHP, C#, PowerShell, Swift, Scala, Kotlin, Elixir, CoffeeScript, Dart, Solidity, Groovy, ABAP, REBOL, X10, Apex, Sophia, Aardvark, Boron

*

Languages without Exceptions include C, progsbase, Speedie

*

View all concepts with or missing a hasExceptions measurement

*

Read more about Exceptions on the web: 1.

View source

- Build the next great programming language About Acknowledgements Part of the World Wide Scroll