开发者

How to catch an exception thrown by JIRA SOAP in VB.NET?

开发者 https://www.devze.com 2023-04-13 05:26 出处:网络
I want to catch the exceptions thrown by the login() function in JIRA\'s SOAP API. The function login throws 2 exceptions. RemoteAuthenticationException if the user prov开发者_C百科ided an invalid use

I want to catch the exceptions thrown by the login() function in JIRA's SOAP API. The function login throws 2 exceptions. RemoteAuthenticationException if the user prov开发者_C百科ided an invalid username or password and RemoteException if there was some problem preventing the operation from working.

Currently I'm using this code to catch the exception

Try
    ...
Catch jiraException As Exception
    MsgBox(jiraException.toString)
End Try

I entered an invalid username and password and printed the exception. It says something like this:

System.ServiceMode.FaultException: com.atlassian.jira.rpc.exception.RemoteAuthenticationException: Invalid username or password.

I want to catch the two exceptions separately. How can I do this? Thanks in advance!


You should be able to catch these as FaultException Of com.atlassian.jira.rpc.exception.RemoteAuthenticationException and FaultException Of com.atlassian.jira.rpc.exception.RemoteException.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号