title: Why aren't drawing exceptions caught when I explicitly ask a control to redraw?
body: <p>I have a GUI app which displays data using a <code>Windows::Forms::DataVisualization::Charting::Chart</code> which works fine most of the time. Just occasionally we get some spurious data which the chart control doesn't like which throws an exception. To try and capture what it is that causes these problems I've wrapped the re-draw request in a try/catch:</p>
  
  <pre><code>try
  {
      m_chart-&gt;Invalidate();
      m_chart-&gt;Update();
  }
  catch(System::Exception^ e)
  {
      // If something goes wrong during the drawing, we probably want to try 
      // and record some more information then re-throw it so we can capture 
      // it properly.
      String^ detailString = String::Format("Exception caught while trying to draw raw data. {0}", "Add more debug info here");
      throw gcnew System::Exception(detailString, e);
  }
  </code></pre>
  
  <p>...for some reason though, the exception isn't thrown there (I have a breakpoint and some logging which never get hit) - it happens at some other point:</p>
  
  <pre><code>Exception:
      Value was either too large or too small for a Decimal.
  Exception type:
      System.OverflowException
  Source:
      mscorlib
  Stack trace:
     at System.Decimal..ctor(Double value)
     at System.Windows.Forms.DataVisualization.Charting.Axis.RoundedValues(Double inter, Boolean shouldStartFromZero, Boolean autoMax, Boolean autoMin, Double&amp; min, Double&amp; max)
     at System.Windows.Forms.DataVisualization.Charting.Axis.EstimateNumberAxis(Double&amp; minimumValue, Double&amp; maximumValue, Boolean shouldStartFromZero, Int32 preferredNumberOfIntervals, Boolean autoMaximum, Boolean autoMinimum)
     at System.Windows.Forms.DataVisualization.Charting.Axis.EstimateAxis(Double&amp; minimumValue, Double&amp; maximumValue, Boolean autoMaximum, Boolean autoMinimum)
     at System.Windows.Forms.DataVisualization.Charting.Axis.EstimateAxis()
     at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultAxesValues()
     at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetData(Boolean initializeAxes, Boolean checkIndexedAligned)
     at System.Windows.Forms.DataVisualization.Charting.ChartArea.ReCalcInternal()
     at System.Windows.Forms.DataVisualization.Charting.ChartPicture.Paint(Graphics graph, Boolean paintTopLevelElementOnly)
     at System.Windows.Forms.DataVisualization.Charting.Chart.OnPaint(PaintEventArgs e)
     at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
     at System.Windows.Forms.Control.WmPaint(Message&amp; m)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  Installed .net Versions:
      v2.0.50727.5420
      v3.0.30729.5420
      v3.5.30729.5420
      v4.0.30319
  </code></pre>
  
  <p>Have I missed something here? Does invalidate / update not trigger the same re-draw that some other part of the windows message pump does?</p>