File: exceptions.py

package info (click to toggle)
python-accuweather 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 320 kB
  • sloc: python: 613; sh: 7; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 654 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Accuweather exceptions."""


class AccuweatherError(Exception):
    """Base class for Accuweather errors."""

    def __init__(self, status: str) -> None:
        """Initialize."""
        super().__init__(status)
        self.status = status


class ApiError(AccuweatherError):
    """Raised when AccuWeather API request ended in error."""


class InvalidApiKeyError(AccuweatherError):
    """Raised when API Key format is invalid."""


class InvalidCoordinatesError(AccuweatherError):
    """Raised when coordinates are invalid."""


class RequestsExceededError(AccuweatherError):
    """Raised when allowed number of requests has been exceeded."""