title: CAF Receiver: Error handling
body: <p>We've created a custom CAF receiver with generic error listener based on cast.framework.events.EventType.ERROR event:</p>
  
  <pre><code>playerManager.addEventListener(cast.framework.events.EventType.ERROR, event =&gt; { 
  if (playerManager.getPlayerState() != "IDLE") {
    let errorCode = (event.detailedErrorCode != undefined ?event.detailedErrorCode : null);
    let errorMessage = null;
    if ((event.error != undefined) &amp;&amp; (event.error.reason != null)) errorMessage = event.error.reason;
  
    playerManager.setIdleReason(cast.framework.messages.IdleReason.ERROR);
    customErrorCodeClass.display(errorCode, errorMessage);
  });
  </code></pre>
  
  <p>This handler works properly, but sometimes the player rise a "404 fragment error" for a single fragment, causing video stopping. We aren't able to know if that error is related for that particular fragment or there will be other 404 fragments, so we can't exclude that errors from error handler.</p>
  
  <p>Does someone knows a better way to work around this issue?</p>