如何在 VB.NET 中捕获 JIRA SOAP 抛出的异常?
我想捕获 JIRA 的 SOAP API 中的 login() 函数抛出的异常。函数登录抛出 2 个异常。如果用户提供了无效的用户名或密码,则出现 RemoteAuthenticationException 异常;如果出现阻止操作运行的问题,则出现 RemoteException 异常。
目前,我正在使用此代码来捕获异常,
Try
...
Catch jiraException As Exception
MsgBox(jiraException.toString)
End Try
我输入了无效的用户名和密码并打印了异常。它说的是这样的:
System.ServiceMode.FaultException: com.atlassian.jira.rpc.exception.RemoteAuthenticationException: 无效的用户名或密码。
我想分别捕获这两个异常。我该怎么做?提前致谢!
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 provided 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够将这些捕获为
FaultException Of com.atlassian.jira.rpc.exception.RemoteAuthenticationException
和FaultException Of com.atlassian.jira.rpc.exception.RemoteException
。You should be able to catch these as
FaultException Of com.atlassian.jira.rpc.exception.RemoteAuthenticationException
andFaultException Of com.atlassian.jira.rpc.exception.RemoteException
.