title: Delphi Error handling : Raise vs Exit on try...except...end
body: <p>Is it safe to call <strong>Exit</strong> on try except?
  Or should I call <strong>raise</strong> instead? </p>
  
  <p>I tried both example below and at raise example, the trace went through Delphi's internal library code. While exit just exit the procedure and nothing more.</p>
  
  <p>I read that it's better to preserve application stack or queue or something like that. Will calling <code>exit</code> will break that stack?</p>
  
  <p><strong>Example 1 (raise)</strong></p>
  
  <pre><code>SDDatabase1.StartTransaction;
  Try
    SDQuery1.ApplyUpdates;
    SDDatabase1.Commit;
    SDQuery1.CommitUpdates;
  Except
    SDDatabase1.Rollback;
    SDQuery1.RollbackUpdates;
    raise;
  End;
  ..............//other codes I don't want to execute
  </code></pre>
  
  <p><strong>Example 2 (exit)</strong></p>
  
  <pre><code>SDDatabase1.StartTransaction;
  Try
    SDQuery1.ApplyUpdates;
    SDDatabase1.Commit;
    SDQuery1.CommitUpdates;
  Except
    SDDatabase1.Rollback;
    SDQuery1.RollbackUpdates;
    MessageDlg('Save Failed because: '+E.Message, mtError, [mbOK], 0);
    exit;
  end;
  ..............//other codes I don't want to execute
  </code></pre>