File: exceptions.py

package info (click to toggle)
python-aemet-opendata 0.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 228 kB
  • sloc: python: 1,731; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 744 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
27
28
29
30
31
"""AEMET OpenData API exceptions."""

from __future__ import annotations


class AemetError(Exception):
    """Base class for AEMET OpenData errors."""


class AemetTimeout(AemetError):
    """Exception raised when API times out."""


class AuthError(AemetError):
    """Exception raised when API denies access."""


class ApiError(AemetError):
    """Exception raised when data is not provided by API."""


class StationNotFound(AemetError):
    """Exception raised when there are no stations close to provided coordinates."""


class TooManyRequests(AemetError):
    """Exception raised when max API requests are exceeded."""


class TownNotFound(AemetError):
    """Exception raised when there are no towns close to provided coordinates."""