Если пользователь вводит данные, которые НЕ находятся на веб-сервере, к которому обращается WSDL, я получаю сообщение об ошибке:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns3="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com" xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<ns2:Body>
<ns1:getFieldsForEdit>
<in0 xsi:type="ns3:string">FmofSimScl</in0>
<in1 xsi:type="ns3:string">QA-65000</in1>
</ns1:getFieldsForEdit>
</ns2:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns3="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com" xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<ns2:Body>
<ns1:getIssue>
<in0 xsi:type="ns3:string">FmofSimScl</in0>
<in1 xsi:type="ns3:string">QA-65000</in1>
</ns1:getIssue>
</ns2:Body>
</SOAP-ENV:Envelope>
Traceback (most recent call last):
File "/home/qa/jira-test/.hg/check_jira.py", line 64, in <module>
main()
File "/home/qa/jira-test/.hg/check_jira.py", line 12, in main
commit_text_verified = verify_commit_text(os.popen('hg tip --template "{desc}"'))
File "/home/qa/jira-test/.hg/check_jira.py", line 35, in verify_commit_text
if CheckForJiraIssueRecord(m_args) == 0:
File "/home/qa/jira-test/.hg/check_jira.py", line 58, in CheckForJiraIssueRecord
issue = com.run(command_name, logger, jira_env, my_args)
File "/home/qa/jira-test/.hg/jira.py", line 1367, in run
return self.commands[command].dispatch(logger, jira_env, args)
File "/home/qa/jira-test/.hg/jira.py", line 75, in dispatch
results = self.run(logger, jira_env, args)
File "/home/qa/jira-test/.hg/jira.py", line 174, in run
logger.error(decode(e))
File "/home/qa/jira-test/.hg/jira.py", line 1434, in decode
str = e.faultstring
AttributeError: 'WebFault' object has no attribute 'faultstring'
transaction abort!
rollback completed
abort: pretxncommit.jira hook exited with status 1
Есть ли способ справиться с этим, чтобы я мог написать свою собственную ошибкуСтрока или предупреждение вместо всего этого.Если я выключаю стандартный вывод, я не получаю данные xml, но я все равно получаю:
transaction abort!
rollback completed
abort: pretxncommit.jira hook exited with status 1
, который взят из mercurial, но было бы неплохо добавить к нему строку ошибки, такую как warnings.warn ("% s не существует "% issue_id)
хорошо, я посмотрел в jira.py и изменил строку 1434: str = e.faultstring на str = e.fault
и получил:
faultcode = "soapenv:Server.userException"
faultstring = "com.atlassian.jira.rpc.exception.RemotePermissionException: This issue does not exist or you don't have permission to view it."
detail =
(detail){
com.atlassian.jira.rpc.exception.RemotePermissionException = ""
hostname = "JIRA"
}
}