Skip to content

Commit 5055d6a

Browse files
authored
cleanup and add link to conceptual doc (dotnet#8845)
1 parent 4be811e commit 5055d6a

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

xml/System.Runtime.ExceptionServices/ExceptionDispatchInfo.xml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@
4444
<format type="text/markdown"><![CDATA[
4545
4646
## Remarks
47-
The <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo> object stores the stack trace information and Watson information that the exception contains at the point where it is captured. The exception can be thrown at another time and possibly on another thread by calling the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw%2A?displayProperty=nameWithType> method. The exception is thrown as if it had flowed from the point where it was captured to the point where the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw%2A> method is called.
48-
49-
<xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo> cannot be serialized and is not intended to cross application domain boundaries.
50-
47+
48+
An <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo> object stores the stack trace information and Watson information that an exception contains at the point where it's captured. The exception can then be thrown at another time and possibly on another thread by calling the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw%2A?displayProperty=nameWithType> method. The exception is thrown as if it had flowed from the point where it was captured to the point where the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw%2A> method is called.
49+
50+
For an example, see [Capture exceptions to rethrow later](/dotnet/standard/exceptions/best-practices-for-exceptions#capture-exceptions-to-rethrow-later).
51+
52+
<xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo> cannot be serialized and is not intended to cross application domain boundaries.
53+
5154
]]></format>
5255
</remarks>
56+
<related type="Article" href="/dotnet/standard/exceptions/best-practices-for-exceptions#capture-exceptions-to-rethrow-later">Capture exceptions to rethrow later</related>
5357
</Docs>
5458
<Members>
5559
<Member MemberName="Capture">
@@ -97,14 +101,15 @@
97101
<format type="text/markdown"><![CDATA[
98102
99103
## Remarks
100-
You can use the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo> object that is returned by this method at another time and possibly on another thread to rethrow the specified exception, as if the exception had flowed from this point where it was captured to the point where it is rethrown.
104+
You can use the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo> object that's returned by this method at another time and possibly on another thread to rethrow the specified exception, as if the exception had flowed from the point where it was captured to the point where it's rethrown.
101105
102-
If the exception is active when it is captured, the current stack trace information and Watson information that is contained in the exception is stored. If it is inactive, that is, if it has not been thrown, it will not have any stack trace information or Watson information.
106+
If the exception is active when it's captured, the current stack trace information and Watson information that's contained in the exception is stored. If it's inactive, that is, if it has not been thrown, it doesn't have any stack trace or Watson information.
103107
104108
]]></format>
105109
</remarks>
106110
<exception cref="T:System.ArgumentException">
107111
<paramref name="source" /> is <see langword="null" />.</exception>
112+
<related type="Article" href="/dotnet/standard/exceptions/best-practices-for-exceptions#capture-exceptions-to-rethrow-later">Capture exceptions to rethrow later</related>
108113
</Docs>
109114
</Member>
110115
<Member MemberName="SetCurrentStackTrace">
@@ -169,27 +174,20 @@
169174
<Parameter Name="stackTrace" Type="System.String" Index="1" FrameworkAlternate="net-6.0;net-7.0" />
170175
</Parameters>
171176
<Docs>
172-
<param name="source">The unthrown <see cref="T:System.Exception" /> instance.</param>
173-
<param name="stackTrace">The stack trace string to persist within <paramref name="source" />. This is normally acquired from the <see cref="P:System.Exception.StackTrace" /> property from the remote exception instance.</param>
177+
<param name="source">The unthrown exception.</param>
178+
<param name="stackTrace">The stack trace string to persist within <paramref name="source" />. This is normally acquired from the <see cref="P:System.Exception.StackTrace" /> property of the remote exception instance.</param>
174179
<summary>Stores the provided stack trace into the specified <see cref="T:System.Exception" /> instance.</summary>
175180
<returns>The <paramref name="source" /> exception instance.</returns>
176181
<remarks>
177182
<format type="text/markdown"><![CDATA[
178183
179184
## Remarks
180185
181-
This method populates the <xref:System.Exception.StackTrace> property from an arbitrary string value.
182-
The typical use case is the transmission of <xref:System.Exception> objects across processes with high fidelity,
183-
allowing preservation of the exception object's stack trace information. .NET does not attempt to parse the
184-
provided string value.
186+
This method populates the <xref:System.Exception.StackTrace> property from an arbitrary string value. The typical use case is the transmission of <xref:System.Exception> objects across processes with high fidelity, allowing preservation of the exception object's stack trace information. .NET does not attempt to parse the provided string value.
185187
186-
The caller is responsible for canonicalizing line endings if required. <xref:System.String.ReplaceLineEndings>
187-
can be used to canonicalize line endings.
188+
The caller is responsible for canonicalizing line endings if required. <xref:System.String.ReplaceLineEndings> can be used to canonicalize line endings.
188189
189-
If the caller provides untrusted input to this API, this may result in the exception's stack trace containing
190-
embedded null characters, reserved HTML or JSON characters, or other unexpected values. Applications that
191-
display an exception's details to the user should always take care to encode the exception information at the
192-
point where it is displayed.
190+
If the caller provides untrusted input to this API, this may result in the exception's stack trace containing embedded null characters, reserved HTML or JSON characters, or other unexpected values. Applications that display an exception's details to the user should always take care to encode the exception information at the point where it's displayed.
193191
194192
]]></format>
195193
</remarks>
@@ -232,13 +230,13 @@ If the caller provides untrusted input to this API, this may result in the excep
232230
<ReturnType>System.Exception</ReturnType>
233231
</ReturnValue>
234232
<Docs>
235-
<summary>Gets the exception that is represented by the current instance.</summary>
236-
<value>The exception that is represented by the current instance.</value>
233+
<summary>Gets the exception that's represented by the current instance.</summary>
234+
<value>The exception that's represented by the current instance.</value>
237235
<remarks>
238236
<format type="text/markdown"><![CDATA[
239237
240238
## Remarks
241-
This property is used by the Task Parallel Library, for example, to combine multiple exceptions in an <xref:System.AggregateException> object. It is not intended to be used by application code. Use the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw%2A> method to restore the state of the captured exception and throw it.
239+
This property is used by the Task Parallel Library, for example, to combine multiple exceptions in an <xref:System.AggregateException> object. It's not intended to be used by application code. Use the <xref:System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw%2A> method to restore the state of the captured exception and throw it.
242240
243241
]]></format>
244242
</remarks>
@@ -286,12 +284,12 @@ If the caller provides untrusted input to this API, this may result in the excep
286284
</ReturnValue>
287285
<Parameters />
288286
<Docs>
289-
<summary>Throws the exception that is represented by the current <see cref="T:System.Runtime.ExceptionServices.ExceptionDispatchInfo" /> object, after restoring the state that was saved when the exception was captured.</summary>
287+
<summary>Throws the exception that's represented by the current <see cref="T:System.Runtime.ExceptionServices.ExceptionDispatchInfo" /> object, after restoring the state that was saved when the exception was captured.</summary>
290288
<remarks>
291289
<format type="text/markdown"><![CDATA[
292290
293291
## Remarks
294-
When the exception is restored, the following string is inserted in the stack trace to indicate the restore point: "End of stack trace from the previous location where the exception was thrown". This is similar to the way inner exceptions or marshaled exceptions are indicated in stack traces.
292+
When the exception is restored, the following string is inserted in the stack trace to indicate the restore point: `"End of stack trace from the previous location where the exception was thrown"`. This is similar to the way inner exceptions or marshaled exceptions are indicated in stack traces.
295293
296294
]]></format>
297295
</remarks>

0 commit comments

Comments
 (0)