m2m-python/m2m/exceptions.py
2026-02-19 08:14:53 +01:00

26 lines
601 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Custom exceptions for the m2m library.
"""
class M2MError(Exception):
"""Base class for all m2m library exceptions."""
pass
class SerialError(M2MError):
"""Raised when a serial communication error occurs."""
pass
class ATCommandError(M2MError):
"""Raised when an AT command returns an error or times out."""
pass
class TimeoutError(M2MError):
"""Raised when an operation times out."""
pass
class NetworkError(M2MError):
"""Raised when a network operation fails (e.g. attach, context activation)."""
pass