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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
f26b9ea2
Commit
f26b9ea2
authored
Jun 02, 2022
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Nov 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_api_style: jIOWebSection jio calls catch NotFound Errors
parent
bb89d035
Changes
1
Show 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 @
f26b9ea2
...
...
@@ -30,6 +30,7 @@
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
Unauthorized
from
Acquisition
import
aq_inner
from
OFS.Traversable
import
NotFound
from
erp5.component.document.WebSection
import
WebSection
from
Products.ERP5Type
import
Permissions
from
zLOG
import
LOG
,
INFO
...
...
@@ -47,13 +48,21 @@ def convertTojIOAPICall(function):
try
:
retval
=
function
(
self
,
*
args
,
**
kwd
)
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
)
return
self
.
ERP5Site_logApiErrorAndReturn
(
error_code
=
"403"
,
error_message
=
str
(
e
),
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
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