Skip to content

Commit 110809b

Browse files
mgoltimmywil
andauthored
Apply suggestions from code review
Co-authored-by: Timmy Willison <[email protected]>
1 parent e6e5371 commit 110809b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

entries/jQuery.Deferred.exceptionHook.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<desc>Handle errors produced by Deferreds.</desc>
88
<longdesc>
99
<p>This API is called every time an error is thrown inside Deferreds. By default, it only warns about errors that are more likely to be programmer errors than errors thrown due to application logic. This includes errors like <code>SyntaxError</code> or <code>ReferenceError</code>.</p>
10-
<p>If you want, you can redefine the API to handle errors the way you like. The function accepts two parameters - the first one is an error thrown and the second, optional one is a "fake" error created before the handler is called so that a stack trace from before an async barrier is available. This second error is only provided if <a href="/jQuery.Deferred.getErrorHook/"><code>jQuery.Deferred.getErrorHook</code></a> is defined; see the docs for that API for more details.</p>
10+
<p>The function accepts two parameters - the first one is the error thrown and the second, optional parameter is a "fake" error created before the handler is called so that a stack trace from before an async barrier is available. This second error is only provided if <a href="/jQuery.Deferred.getErrorHook/"><code>jQuery.Deferred.getErrorHook</code></a> is defined; see the docs for that API for more details.</p>
1111
<h3>Example</h3>
1212
<pre><code><![CDATA[
13-
// These usually indicate a programmer mistake during development,
13+
// These usually indicate a programmer mistake during development;
1414
// warn about them ASAP rather than swallowing them by default.
1515
var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
1616

entries/jQuery.Deferred.getErrorHook.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<desc>Return an Error instance with a defined stack.</desc>
88
<longdesc>
99
<div class="warning">
10-
<p>Note: This API is not defined by default. It may be provided by the user and jQuery will then use it internally.</p>
10+
<p>Note: This API is not defined by default, but jQuery will make use of it when defined.</p>
1111
</div>
1212
<p>When <code>jQuery.Deferred.getErrorHook</code> is defined, it extends the <code>jQuery.Deferred</code> features added in jQuery 3.0 to include an error captured before the async barrier whenever a Deferred throws an exception. This makes it easier to find programming errors that occur inside Deferreds. You can find an example implementation you can copy-paste below, or you can use <a href="https://github.com/dmethvin/jquery-deferred-reporter">jquery-deferred-reporter</a> plugin.</p>
1313
<pre><code>

0 commit comments

Comments
 (0)