2 # vi: set softtabstop=4 shiftwidth=4 tabstop=8 expandtab:
4 """usage: from PlannerExceptions import *"""
6 class TravelPlannerException(Exception):
7 """Generic parent exception for anything thrown by us, as opposed to
8 things thrown by the network layer."""
10 def __init__(self
, value
):
11 Exception.__init
__(self
, value
)
13 class InvalidLocationException(TravelPlannerException
):
14 """Thrown when a source or destination can't be found.
16 The "args" value of the exception is the original Location."""
18 def __init__(self
, location
):
19 TravelPlannerException
.__init
__(self
, location
)
21 class ItineraryParseException(TravelPlannerException
):
22 """Thrown when the itinerary returned by the travel planner can't be
25 def __init__(self
, msg
):
26 TravelPlannerException
.__init
__(self
, msg
)