Full location support with partial match smartitty
[ottawa-travel-planner.git] / PlannerExceptions.py
blobc50680d23c9b55a1b6a7dde9b8534d09e5e0b212
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
23 parsed."""
25 def __init__(self, msg):
26 TravelPlannerException.__init__(self, msg)