Skip to content

init

Module to store common service functions.

CityNameError (ValueError)

Invalid city name error.

Source code in now8_api/service/__init__.py
class CityNameError(ValueError):
    """Invalid city name error."""

    def __init__(self, city_name: str):
        """Set the error message and raise the exception.

        Arguments:
            city_name: Invalid city name passed.
        """
        message = f"Invalid city name '{city_name}'."
        super().__init__(message)

__init__(self, city_name) special

Set the error message and raise the exception.

Parameters:

Name Type Description Default
city_name str

Invalid city name passed.

required
Source code in now8_api/service/__init__.py
def __init__(self, city_name: str):
    """Set the error message and raise the exception.

    Arguments:
        city_name: Invalid city name passed.
    """
    message = f"Invalid city name '{city_name}'."
    super().__init__(message)

StopIdError (ValueError)

Invalid stop ID error.

Source code in now8_api/service/__init__.py
class StopIdError(ValueError):
    """Invalid stop ID error."""

    def __init__(self, stop_id: str):
        """Set the error message and raise the exception.

        Arguments:
            stop_id: Invalid stop identifier passed.
        """
        message = f"Invalid stop ID '{stop_id}'."
        super().__init__(message)

__init__(self, stop_id) special

Set the error message and raise the exception.

Parameters:

Name Type Description Default
stop_id str

Invalid stop identifier passed.

required
Source code in now8_api/service/__init__.py
def __init__(self, stop_id: str):
    """Set the error message and raise the exception.

    Arguments:
        stop_id: Invalid stop identifier passed.
    """
    message = f"Invalid stop ID '{stop_id}'."
    super().__init__(message)

TransportTypeError (ValueError)

Invalid transport type error.

Source code in now8_api/service/__init__.py
class TransportTypeError(ValueError):
    """Invalid transport type error."""

    def __init__(self, transport_type: str):
        """Set the error message and raise the exception.

        Arguments:
            transport_type: Invalid transport type passed.
        """
        message = f"Invalid transport type '{transport_type}'."
        super().__init__(message)

__init__(self, transport_type) special

Set the error message and raise the exception.

Parameters:

Name Type Description Default
transport_type str

Invalid transport type passed.

required
Source code in now8_api/service/__init__.py
def __init__(self, transport_type: str):
    """Set the error message and raise the exception.

    Arguments:
        transport_type: Invalid transport type passed.
    """
    message = f"Invalid transport type '{transport_type}'."
    super().__init__(message)

Last update: 2022-08-05