M callback/__init__.py +2 -2
@@ 1,10 1,10 @@
from callback import callback_manager
from base import CallbackException, CallbackBase
-from signals import stored_callback, processed_callback
+from signals import stored_callback, processed_callback, error_callback
__version__ = '0.3'
__all__ = [
'CallbackException', 'CallbackBase', 'callback_manager',
- 'stored_callback', 'processed_callback',
+ 'stored_callback', 'processed_callback', 'error_callback',
]
M callback/callback.py +6 -1
@@ 1,7 1,7 @@
from django.db import models
from models import CallbackMap
from base import CallbackException, CallbackBase
-from signals import stored_callback, processed_callback
+from signals import stored_callback, processed_callback, error_callback
REQUIRED_METHODS = ('process',)
@@ 68,6 68,11 @@ class CallbackManager(object):
)
except Exception, e:
callback_instance.mark_error(str(e))
+ error_callback.send(
+ sender=self,
+ callback_instance=callback_instance,
+ model_instance=model,
+ )
raise CallbackException(str(e))
M callback/signals.py +4 -0
@@ 8,3 8,7 @@ stored_callback = dispatch.Signal(
processed_callback = dispatch.Signal(
providing_args=['callback_instance', 'model_instance'],
)
+
+error_callback = dispatch.Signal(
+ providing_args=['callback_instance', 'model_instance'],
+)