title: Spark CSV Dataframe Load ,File not found
body: <p>How to catch exception , if my file is not found in given location in spark csv read?</p>
  
  <pre><code>try {
      val df = sqlCxt.read.format("csv")
      .option("delimiter", "|")
      .load("C:/Users/swapnil.shirke/Downloads/dataset/u.item");
  
  }
  catch {
  
  case ex: FileNotFoundException =&gt; {
  println(" file missing exception")
  }
  case ex: Exception =&gt; ex.printStackTrace()
  }
  </code></pre>
  
  <p>given try catch condition not worked.</p>