title: JsonSerializationException Parsing
body: <p>I'm trying to wrap my application with some graceful exception handling. When my app fails to deserialize JSON, I get a <code>JsonSerializationException</code> that has a Message that looks like this:</p>
  
  <blockquote>
    <p>Error converting value "[IncorrectDataType]" to type 'ApexFramework.Enums+DataTypes'. Path 'Layout[0].ElementContainer[0].ContainerDatatype', line 12, position 58.</p>
  </blockquote>
  
  <p>From this exception message, I am interested in capturing and presenting in a clean manner the following:</p>
  
  <ul>
  <li>I need the Index of the Element Container in Layout[] (this would be 0 from the above example)</li>
  <li>I need the Index of the ContainerDataType in ElementContainer[] (this would be 0 from the above example)</li>
  </ul>
  
  <p>I looked through the </p>
  
  <pre><code>JsonSerializationException
  </code></pre>
  
  <p>object and there is nothing that I grab with ease, so:</p>
  
  <p>Can anyone confirm that there is no way to work with the <code>JsonSerializationException</code> to get the info I need in a clean manner?</p>
  
  <p>If not, can anyone help me come up with the most elegant and efficient way to grab the info I need from the exception stack?</p>