Revision ccab6eb5 snf-astakos-app/astakos/im/notifications.py

b/snf-astakos-app/astakos/im/notifications.py
34 34
import logging
35 35
import socket
36 36

  
37
from smtplib import SMTPException
38

  
37 39
from django.conf import settings
38 40
from django.core.mail import send_mail
39 41
from django.utils.translation import ugettext as _
......
64 66
                self.sender,
65 67
                self.recipients
66 68
            )
67
        except BaseException, e:
69
        except (SMTPException, socket.error), e:
68 70
            logger.exception(e)
69
            raise SendNotificationError()
70

  
71
class SendMailError(Exception):
72
    pass
71
            raise NotificationError()
73 72

  
74
class SendNotificationError(SendMailError):
73
class NotificationError(Exception):
75 74
    def __init__(self):
76 75
        self.message = _(astakos_messages.NOTIFICATION_SEND_ERR)
77
        super(SendNotificationError, self).__init__()
76
        super(NotificationError, self).__init__()

Also available in: Unified diff