mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-09 14:40:53 +00:00
drop async-service dep and copy relevant code into a local async_service
tool, updated for modern handling of ExceptionGroup
This commit is contained in:
26
libp2p/tools/async_service/exceptions.py
Normal file
26
libp2p/tools/async_service/exceptions.py
Normal file
@ -0,0 +1,26 @@
|
||||
# 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.
|
||||
"""
|
||||
Reference in New Issue
Block a user