Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
52bf4e55
Commit
52bf4e55
authored
Apr 08, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rarranged error handling and fixed up minor bug.
parent
f7484c60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
28 deletions
+29
-28
lib/python/OFS/Document.py
lib/python/OFS/Document.py
+29
-28
No files found.
lib/python/OFS/Document.py
View file @
52bf4e55
"""Document object"""
__version__
=
'$Revision: 1.
49
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
50
$'
[
11
:
-
2
]
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
from
string
import
join
,
split
,
strip
,
rfind
,
atoi
,
lower
...
...
@@ -73,34 +73,35 @@ class Document(cDocumentTemplate.cDocument, HTML, Explicit,
""" """
kw
[
'document_id'
]
=
self
.
id
kw
[
'document_title'
]
=
self
.
title
try
:
r
=
apply
(
HTML
.
__call__
,
(
self
,
client
,
REQUEST
),
kw
)
except
:
if
self
.
id
()
==
'standard_error_message'
:
raise
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
error_type
=
sys
.
exc_type
error_value
=
sys
.
exc_value
if
lower
(
error_type
)
in
(
'redirect'
,):
raise
error_type
,
error_value
,
sys
.
exc_traceback
if
regex
.
search
(
'[a-zA-Z]>'
,
error_value
)
>
0
:
error_message
=
error_value
else
:
error_message
=
''
tb
=
sys
.
exc_traceback
error_tb
=
pretty_tb
(
error_type
,
error_value
,
tb
)
if
client
is
not
None
:
c
=
client
else
:
c
=
self
.
aq_parent
try
:
s
=
getattr
(
c
,
'standard_error_message'
)
v
=
HTML
.
__call__
(
s
,
c
,
REQUEST
,
error_type
=
error_type
,
error_value
=
error_value
,
error_tb
=
error_tb
,
error_traceback
=
error_tb
,
error_message
=
error_message
)
try
:
try
:
r
=
apply
(
HTML
.
__call__
,
(
self
,
client
,
REQUEST
),
kw
)
except
:
v
=
'Sorry, an error occured'
sys
.
exc_traceback
=
tb
tb
=
None
raise
error_type
,
v
,
sys
.
exc_traceback
if
self
.
id
()
==
'standard_error_message'
:
raise
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
error_type
=
sys
.
exc_type
error_value
=
sys
.
exc_value
tb
=
sys
.
exc_traceback
if
lower
(
error_type
)
in
(
'redirect'
,):
raise
error_type
,
error_value
,
tb
if
(
type
(
error_value
)
is
type
(
''
)
and
regex
.
search
(
'[a-zA-Z]>'
,
error_value
)
>
0
):
error_message
=
error_value
else
:
error_message
=
''
error_tb
=
pretty_tb
(
error_type
,
error_value
,
tb
)
if
client
is
not
None
:
c
=
client
else
:
c
=
self
.
aq_parent
try
:
s
=
getattr
(
c
,
'standard_error_message'
)
v
=
HTML
.
__call__
(
s
,
c
,
REQUEST
,
error_type
=
error_type
,
error_value
=
error_value
,
error_tb
=
error_tb
,
error_traceback
=
error_tb
,
error_message
=
error_message
)
except
:
v
=
'Sorry, an error occured'
raise
error_type
,
v
,
tb
finally
:
tb
=
None
if
RESPONSE
is
None
:
return
r
return
decapitate
(
r
,
RESPONSE
)
...
...
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