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
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
Nicolas Wavrant
ZODB
Commits
84755074
Commit
84755074
authored
Mar 07, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add AbortError and IllegalStateError, two specialized TransactionError
classes.
parent
dc03221a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
src/transaction/interfaces.py
src/transaction/interfaces.py
+23
-0
No files found.
src/transaction/interfaces.py
View file @
84755074
...
@@ -22,6 +22,29 @@ class ConflictError(TransactionError):
...
@@ -22,6 +22,29 @@ class ConflictError(TransactionError):
This transaction should be resubmitted.
This transaction should be resubmitted.
"""
"""
class
IllegalStateError
(
TransactionError
):
"""An operation was invoked that wasn't valid in the current
transaction state.
"""
def
__init__
(
self
,
verb
,
state
):
self
.
_verb
=
verb
self
.
_state
=
state
def
__str__
(
self
):
return
"Can't %s transaction in %s state"
%
(
self
.
_verb
,
self
.
_state
)
class
AbortError
(
TransactionError
):
"""Transaction commit failed and the application must abort."""
def
__init__
(
self
,
datamgr
):
self
.
datamgr
=
datamgr
def
__str__
(
self
):
str
=
self
.
__class__
.
__doc__
+
" Failed data manager: %s"
return
str
%
self
.
datamgr
class
RollbackError
(
TransactionError
):
class
RollbackError
(
TransactionError
):
"""An error occurred rolling back a savepoint."""
"""An error occurred rolling back a savepoint."""
...
...
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