Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
ZEO
Commits
0937d2a5
Commit
0937d2a5
authored
Apr 12, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provided specialised string representations for UndoErrors.
parent
fa995af9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
src/ZODB/POSException.py
src/ZODB/POSException.py
+25
-2
No files found.
src/ZODB/POSException.py
View file @
0937d2a5
...
...
@@ -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