knowhow-server
Version:
A personal workflow engine that can manage and use any network connected host
28 lines (27 loc) • 2.16 kB
HTML
<a href="http://github.com/angular/angular.js/tree/v1.2.9/src/ngMock/angular-mocks.js#L182" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">$exceptionHandlerProvider</code>
<div><span class="hint">service in module <code ng:non-bindable="">ngMock</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="ngmock-exceptionhandlerprovider-page"><p>Configures the mock implementation of <a href="api/ng.$exceptionHandler"><code>ng.$exceptionHandler</code></a> to rethrow or to log errors
passed into the <code>$exceptionHandler</code>.</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><h3 id="methods_mode">mode(mode)</h3>
<div class="mode"><div class="ngmock-exceptionhandlerprovider-mode-page"><p>Sets the logging mode.</p>
</div><h5 id="methods_mode_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>mode</td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="ngmock-exceptionhandlerprovider-mode-page"><p>Mode of operation, defaults to <code>rethrow</code>.</p>
<ul>
<li><code>rethrow</code>: If any errors are passed into the handler in tests, it typically<pre><code> means that there is a bug in the application or test, so this mock will
make these tests fail.</code></pre>
</li>
<li><code>log</code>: Sometimes it is desirable to test that an error is thrown, for this case the <code>log</code><pre><code> mode stores an array of errors in `$exceptionHandler.errors`, to allow later
assertion of them. See <a href="api/ngMock.$log#assertempty">assertEmpty()</a> and
<a href="api/ngMock.$log#reset">reset()</a></code></pre>
</li>
</ul>
</div></td></tr></tbody></table></div>
</li>
</ul>
</div>
</div>