Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1229
Command-Line Input
Active
Public
Actions
Authored by
olasd
on Dec 2 2021, 5:02 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
from
functools
import
wraps
def
handle_raise_on_commit
(
f
):
@wraps
(
f
)
def
inner
(
self
,
*
args
,
**
kwargs
):
try
:
f
(
self
,
*
args
,
**
kwargs
)
return
True
except
:
# noqa: E722
# Unexpected error occurred, rollback all changes and log message
LOGGER
.
exception
(
"Unexpected error"
)
if
self
.
raise_on_commit
:
raise
return
False
return
inner
Event Timeline
olasd
created this paste.
Dec 2 2021, 5:02 PM
2021-12-02 17:02:55 (UTC+1)
olasd
updated the paste's language from
autodetect
to
python
.
Dec 2 2021, 5:03 PM
2021-12-02 17:03:07 (UTC+1)
Log In to Comment