title: Bubble exception outside Angular
body: <p>I'm using AngularJS 1.5.x to dynamically add a javascript tag and code to the DOM, which will be executed by FramerJS.</p>
  
  <p>Occasionally this will throw errors and is desired and expected.</p>
  
  <p>FramerJS has it's own way of handling errors and displaying them nicely within the DOM to the user</p>
  
  <pre><code>Events.wrap(window).addEventListener "error", (e) =&gt;
                  @showError(e.message)
  </code></pre>
  
  <p>FramerJS showError is a private method and not accessible.</p>
  
  <p>I know I can extend/decorate Angular's excpetion handler like so <a href="https://docs.angularjs.org/api/ng/service/" rel="nofollow">https://docs.angularjs.org/api/ng/service/</a>$exceptionHandler</p>
  
  <p>My problem is if I use this method to throw a new error that is available on the window I will cause an infinite $digest loop, handling my own errors I create.</p>
  
  <p>Can anyone point me in the right direction here? Should I go about monkey patching FramerJS to give me access to the showError method I need, or is there something I'm missing.</p>
  
  <p>First stackoverflow question, apologies if it's not in the right format.</p>