<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
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho