<exception> (Visual Basic)
Specifies which exceptions can be thrown.
Syntax
<exception cref="member">description</exception>
Parameters
member
A reference to an exception that is available from the current compilation environment. The compiler checks that the given exception exists and translates member
to the canonical element name in the output XML. member
must appear within double quotation marks (" ").
description
A description.
Remarks
Use the <exception>
tag to specify which exceptions can be thrown. This tag is applied to a method definition.
Compile with -doc to process documentation comments to a file.
Example
This example uses the <exception>
tag to describe an exception that the IntDivide
function can throw.
''' <exception cref="System.OverflowException">
''' Thrown when <paramref name="denominator"/><c> = 0</c>.
''' </exception>
Public Function IntDivide(
ByVal numerator As Integer,
ByVal denominator As Integer
) As Integer
Return numerator \ denominator
End Function
See also
שתף איתנו פעולה ב- GitHub
ניתן למצוא את המקור לתוכן זה ב- GitHub, שם ניתן גם ליצור ולסקור בעיות ולמשוך בקשות. לקבלת מידע נוסף, עיין במדריך התורמים שלנו.