Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
ec9aa98f
Commit
ec9aa98f
authored
Apr 12, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provided specialised string representations for UndoErrors.
parent
a656c281
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
trunk/src/ZODB/POSException.py
trunk/src/ZODB/POSException.py
+25
-2
No files found.
trunk/src/ZODB/POSException.py
View file @
ec9aa98f
...
...
@@ -84,9 +84,12 @@
##############################################################################
'''BoboPOS-defined exceptions
$Id: POSException.py,v 1.
6 2001/02/08 22:25:59 chris
m Exp $'''
__version__
=
'$Revision: 1.
6
$'
[
11
:
-
2
]
$Id: POSException.py,v 1.
7 2001/04/12 20:47:00 ji
m Exp $'''
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
from
string
import
join
StringType
=
type
(
''
)
DictType
=
type
({})
class
POSError
(
Exception
):
"""Persistent object system error
...
...
@@ -117,6 +120,26 @@ class VersionLockError(VersionError, TransactionError):
class
UndoError
(
POSError
):
"""An attempt was made to undo a non-undoable transaction.
"""
def
__init__
(
self
,
*
reason
):
if
len
(
reason
)
==
1
:
reason
=
reason
[
0
]
self
.
__reason
=
reason
def
__repr__
(
self
):
reason
=
self
.
__reason
if
type
(
reason
)
is
not
DictType
:
if
reason
:
return
str
(
reason
)
return
"non-undoable transaction"
r
=
[]
for
oid
,
reason
in
reason
.
items
():
if
reason
:
r
.
append
(
"Couldn't undo change to %s because %s"
%
(
`oid`
,
reason
))
else
:
r
.
append
(
"Couldn't undo change to %s"
%
(
`oid`
))
return
join
(
r
,
'
\
n
'
)
__str__
=
__repr__
class
StorageError
(
POSError
):
pass
...
...
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