title: Issue raising an error in after trigger
body: <p>I'm having an issue raising an error in an after trigger, and I don't see any reason why I can raise an error one way, but not the other. Let me give you an example.</p>
  
  <p>The following trigger will fail and raise the following error:</p>
  
  <blockquote>
    <p>Error:Apex trigger tstTrigger2 caused an unexpected exception, contact
    your administrator: tstTrigger2 : execution of AfterUpdate caused by:
    System.FinalException: SObject row does not allow errors:
    Trigger.tstTrigger2 : line 19, column 1</p>
  </blockquote>
  
  <pre><code>trigger tstTrigger2 on Account (after update) 
  {  
  
  
      Set&lt;Id&gt; AccountIds = Trigger.newMap.keySet();
  
  
      List&lt;Account &gt; accountsToProcess = [Select Id, Name from Account Where Id IN : AccountIds];
  
  
      for(Account act: accountsToProcess)
      {
  
          act.addError('doesn't work');
  
      }    
  
  }
  </code></pre>
  
  <p>However, raising an error this way works. Please note there is always ever only 1 record in the keyset, at least in this test scenario.</p>
  
  <pre><code>trigger tstTrigger on Account (after update) 
  {  
  
  
      Set&lt;Id&gt; AccountIds = Trigger.newMap.keySet();
  
  
      List&lt;Account &gt; accountsToProcess = [Select Id, Name from Account Where Id IN : AccountIds];
  
  
      Trigger.new[0].addError('However, this works?');
  
  }
  </code></pre>
  
  <p>Any explanation of why the first one is failing, and the second one is not is greatly appreciated. As well, if you could point me to the best way to implement this so that it's bulkified that would be great. Thanks!</p>