<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>exceptions on Dan Lowe</title>
    <link>https://danlowe.me/tags/exceptions/</link>
    <description>Recent content in exceptions on Dan Lowe</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>dan@danlowe.me (Dan Lowe)</managingEditor>
    <webMaster>dan@danlowe.me (Dan Lowe)</webMaster>
    <lastBuildDate>Fri, 09 Mar 2018 01:30:25 -0500</lastBuildDate>
    
	<atom:link href="https://danlowe.me/tags/exceptions/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Why Kotlin? An Introduction. (Part 3)</title>
      <link>https://danlowe.me/post/2018-03-09-kotlin-3/</link>
      <pubDate>Fri, 09 Mar 2018 01:30:25 -0500</pubDate>
      <author>dan@danlowe.me (Dan Lowe)</author>
      <guid>https://danlowe.me/post/2018-03-09-kotlin-3/</guid>
      <description>Lets follow up the discussion about nullability and talk about error handling in Kotlin. Syntactically, the differences from Java are pretty nominal, except for one pretty major key difference that I&#39;ll get to in just a second.
First some code to demonstrate how similar Kotlin Exceptions are to Java&#39;s Exception handling:
fun doSomething(data : String) { if(data.contains(&amp;#34;test&amp;#34;)) { throw IllegalStateException(&amp;#34;Test!&amp;#34;) } } fun main() { try { doSomething(&amp;#34;testData&amp;#34;) } catch (e : Exception) { // This will always get called because an exception is thrown if a String containing &amp;#34;test&amp;#34; is passed to doSomething(.</description>
    </item>
    
  </channel>
</rss>