Detail 속성을 사용하여 특정 오류 처리
예외를 추가로 분류하기 위해 Reporting Services는 SOAP 예외의 Detail 속성에 있는 자식 요소의 InnerText 속성에 다른 오류 정보를 반환합니다. Detail 속성은 XmlNode 개체이므로 다음 코드를 사용하여 Message 자식 요소의 내부 텍스트에 액세스할 수 있습니다.
Detail 속성에 포함된 사용 가능한 모든 자식 요소 목록은 Detail 속성을 참조하세요. 자세한 내용은 Microsoft .NET Framework SDK 설명서의 "Detail Property"를 참조하세요.
Try
' Code for accessing the report server
Catch ex As SoapException
' The exception is a SOAP exception, so use
' the Detail property's Message element.
Console.WriteLine(ex.Detail("Message").InnerXml)
End Try
try
{
// Code for accessing the report server
}
catch (SoapException ex)
{
// The exception is a SOAP exception, so use
// the Detail property's Message element.
Console.WriteLine(ex.Detail["Message"].InnerXml);
}
Try
' Code for accessing the report server
Catch ex As SoapException
If ex.Detail("ErrorCode").InnerXml = "rsInvalidItemName" Then
End If ' Perform an action based on the specific error code
End Try
try
{
// Code for accessing the report server
}
catch (SoapException ex)
{
if (ex.Detail["ErrorCode"].InnerXml == "rsInvalidItemName")
{
// Perform an action based on the specific error code
}
}
다음 코드 줄은 SOAP 예외로 콘솔에 반환되는 특정 오류 코드를 작성합니다. 오류 코드를 평가하고 특정 동작을 수행할 수도 있습니다.
Console.WriteLine(ex.Detail("ErrorCode").InnerXml)
Console.WriteLine(ex.Detail["ErrorCode"].InnerXml);
관련 콘텐츠
Reporting Services의 예외 관리 소개
Reporting Services SoapException 클래스
SoapException 오류 테이블
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기