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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
c7fd71a5
Commit
c7fd71a5
authored
Jun 02, 2022
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Mar 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_api_style: jIOWebSection jio calls catch NotFound Errors
parent
12f5610b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
bt5/erp5_api_style/DocumentTemplateItem/portal_components/document.erp5.jIOWebSection.py
...lateItem/portal_components/document.erp5.jIOWebSection.py
+10
-1
No files found.
bt5/erp5_api_style/DocumentTemplateItem/portal_components/document.erp5.jIOWebSection.py
View file @
c7fd71a5
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
Unauthorized
from
AccessControl
import
Unauthorized
from
Acquisition
import
aq_inner
from
Acquisition
import
aq_inner
from
OFS.Traversable
import
NotFound
from
erp5.component.document.WebSection
import
WebSection
from
erp5.component.document.WebSection
import
WebSection
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
zLOG
import
LOG
,
INFO
from
zLOG
import
LOG
,
INFO
...
@@ -47,13 +48,21 @@ def convertTojIOAPICall(function):
...
@@ -47,13 +48,21 @@ def convertTojIOAPICall(function):
try
:
try
:
retval
=
function
(
self
,
*
args
,
**
kwd
)
retval
=
function
(
self
,
*
args
,
**
kwd
)
except
Unauthorized
,
e
:
except
Unauthorized
,
e
:
LOG
(
'
SlapTool
'
,
INFO
,
'Converting Unauthorized to Unauthorized error mesage in JSON,'
,
LOG
(
'
jIOWebSection
'
,
INFO
,
'Converting Unauthorized to Unauthorized error mesage in JSON,'
,
error
=
True
)
error
=
True
)
return
self
.
ERP5Site_logApiErrorAndReturn
(
return
self
.
ERP5Site_logApiErrorAndReturn
(
error_code
=
"403"
,
error_code
=
"403"
,
error_message
=
str
(
e
),
error_message
=
str
(
e
),
error_name
=
"Unauthorized"
error_name
=
"Unauthorized"
)
)
except
NotFound
,
e
:
LOG
(
'jIOWebSection'
,
INFO
,
'Converting NotFound to NotFound error mesage in JSON,'
,
error
=
True
)
return
self
.
ERP5Site_logApiErrorAndReturn
(
error_code
=
"404"
,
error_message
=
str
(
e
),
error_name
=
"NotFound"
)
return
'%s'
%
retval
return
'%s'
%
retval
wrapper
.
__doc__
=
function
.
__doc__
wrapper
.
__doc__
=
function
.
__doc__
...
...
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