Add parcelnotfound exception
This commit is contained in:
parent
59b573cc8e
commit
828509d72a
1 changed files with 12 additions and 1 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
from .base import CapBase, BaseObject, Field, StringField
|
from .base import CapBase, BaseObject, Field, StringField, UserError
|
||||||
from .date import DateField
|
from .date import DateField
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,6 +30,7 @@ class Event(BaseObject):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return u'<Event date=%r activity=%r location=%r>' % (self.date, self.activity, self.location)
|
return u'<Event date=%r activity=%r location=%r>' % (self.date, self.activity, self.location)
|
||||||
|
|
||||||
|
|
||||||
class Parcel(BaseObject):
|
class Parcel(BaseObject):
|
||||||
STATUS_UNKNOWN = 0
|
STATUS_UNKNOWN = 0
|
||||||
STATUS_PLANNED = 1
|
STATUS_PLANNED = 1
|
||||||
|
|
@ -50,6 +51,16 @@ class CapParcel(CapBase):
|
||||||
:param id: ID of the parcel
|
:param id: ID of the parcel
|
||||||
:type id: :class:`str`
|
:type id: :class:`str`
|
||||||
:rtype: :class:`Parcel`
|
:rtype: :class:`Parcel`
|
||||||
|
:raises: :class:`ParcelNotFound`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
raise NotImplementedError()
|
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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue