Files
py-libp2p/libp2p/tools/async_service/exceptions.py
pacrob d9b92635c1 drop async-service dep and copy relevant code into a local async_service
tool, updated for modern handling of ExceptionGroup
2024-05-27 12:14:36 -06:00

27 lines
580 B
Python

# Copied from https://github.com/ethereum/async-service
class ServiceException(Exception):
"""
Base class for Service exceptions
"""
class LifecycleError(ServiceException):
"""
Raised when an action would violate the service lifecycle rules.
"""
class DaemonTaskExit(ServiceException):
"""
Raised when an action would violate the service lifecycle rules.
"""
class TooManyChildrenException(ServiceException):
"""
Raised when a service adds too many children. It is a sign of task leakage
that needs to be prevented.
"""