How to catch an exception thrown by JIRA SOAP in VB.NET?
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
.
精彩评论