title: Databricks - Try catch between cells
body: <p>I am using Databricks for my scala / spark execution and having few issues with Try / Catch method.</p>
  <p>Databricks Notebook Cell 1:</p>
  <pre><code>try{
  val b = &quot;123a&quot;
  val c = print(b.toInt)
  } catch {
  case e:Exception=&gt;
  throw new Exception(e)
  }
  
  val b = &quot;123a&quot;
  </code></pre>
  <p>When I execute the above code, it throws the 'NumberFormatException' and it does not print b:123a</p>
  <p>But, when I give both the statements in different blocks within notebook,</p>
  <p>Block 1:</p>
  <pre><code>try{
  val b = &quot;123a&quot;
  val c = print(b.toInt)
  } catch {
  case e:Exception=&gt;
  throw new Exception(e)
  }
  </code></pre>
  <p>Block 2:</p>
  <pre><code>val b = &quot;123a&quot;
  </code></pre>
  <p>When I execute the whole notebook, it still throws the exception in the Block 1 and executes the Block 2.</p>
  <p>Is there a way stop executing other blocks when there is an exception.</p>