Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
af919f68
Commit
af919f68
authored
Oct 14, 2020
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_dqe: Return empty dict in timeout or failure
anyway, what happened is stored in the HTTP Exchange
parent
eb353856
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
bt5/erp5_dqe/DocumentTemplateItem/portal_components/document.erp5.DQEDataValidatorClientConnector.py
...mponents/document.erp5.DQEDataValidatorClientConnector.py
+2
-5
No files found.
bt5/erp5_dqe/DocumentTemplateItem/portal_components/document.erp5.DQEDataValidatorClientConnector.py
View file @
af919f68
...
@@ -15,9 +15,6 @@ class DQEDataValidatorClientConnector(XMLObject):
...
@@ -15,9 +15,6 @@ class DQEDataValidatorClientConnector(XMLObject):
params
=
None
,
params
=
None
,
archive_kw
=
None
,
archive_kw
=
None
,
):
):
TIMEOUT
=
-
1
FAILURE
=
-
2
if
params
is
None
:
if
params
is
None
:
params
=
{}
params
=
{}
params
[
'Licence'
]
=
self
.
getLicenseNumber
()
params
[
'Licence'
]
=
self
.
getLicenseNumber
()
...
@@ -28,7 +25,7 @@ class DQEDataValidatorClientConnector(XMLObject):
...
@@ -28,7 +25,7 @@ class DQEDataValidatorClientConnector(XMLObject):
response
=
requests
.
get
(
base_url
,
params
=
params
,
timeout
=
self
.
getTimeout
())
response
=
requests
.
get
(
base_url
,
params
=
params
,
timeout
=
self
.
getTimeout
())
except
(
Timeout
,
timeout
,
ConnectionError
):
except
(
Timeout
,
timeout
,
ConnectionError
):
raw_response
=
'TIMEOUT'
raw_response
=
'TIMEOUT'
result_dict
=
{
'1'
:
{
self
.
getPortalObject
().
Base_getDQEServiceToErrorKeyDict
().
get
(
service
):
TIMEOUT
}
}
result_dict
=
{}
else
:
else
:
if
response
.
ok
:
if
response
.
ok
:
raw_response
=
response
.
content
raw_response
=
response
.
content
...
@@ -39,7 +36,7 @@ class DQEDataValidatorClientConnector(XMLObject):
...
@@ -39,7 +36,7 @@ class DQEDataValidatorClientConnector(XMLObject):
'DQEDataValidatorClientConnector returns Non-ok response : %s'
%
response
.
text
'DQEDataValidatorClientConnector returns Non-ok response : %s'
%
response
.
text
)
)
raw_response
=
response
.
text
raw_response
=
response
.
text
result_dict
=
{
'1'
:
{
self
.
getPortalObject
().
Base_getDQEServiceToErrorKeyDict
().
get
(
service
):
FAILURE
}
}
result_dict
=
{}
finally
:
finally
:
archiveExchange
=
self
.
_getTypeBasedMethod
(
'archiveExchange'
)
archiveExchange
=
self
.
_getTypeBasedMethod
(
'archiveExchange'
)
if
archiveExchange
is
not
None
:
if
archiveExchange
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment