diff --git a/weboob/capabilities/parcel.py b/weboob/capabilities/parcel.py index ea483045aa8f4b9166c1974be7ee455a430b24d1..9b5ee0f7ebbeede094f1b3120faf065c43ae1db5 100644 --- a/weboob/capabilities/parcel.py +++ b/weboob/capabilities/parcel.py @@ -18,7 +18,7 @@ # along with weboob. If not, see . -from .base import CapBase, BaseObject, Field, StringField +from .base import CapBase, BaseObject, Field, StringField, UserError from .date import DateField @@ -30,6 +30,7 @@ class Event(BaseObject): def __repr__(self): return u'' % (self.date, self.activity, self.location) + class Parcel(BaseObject): STATUS_UNKNOWN = 0 STATUS_PLANNED = 1 @@ -50,6 +51,16 @@ def get_parcel_tracking(self, id): :param id: ID of the parcel :type id: :class:`str` :rtype: :class:`Parcel` + :raises: :class:`ParcelNotFound` """ raise NotImplementedError() + + +class ParcelNotFound(UserError): + """ + Raised when a parcell is not found. + It can be an user error, or an expired parcel + """ + def __init__(self, msg='Account not found'): + UserError.__init__(self, msg)