blitz_api/app/lightning/exceptions.py
fusion44 6b67681fd3
feat: improve list-channels endpoint
* new parameters (include_closed, peer_alias_lookup)
* returns the channel state, initiator and the closer if applicable
* CLN gRPC remains TODO

refs #199
2023-06-25 08:28:35 +02:00

23 lines
711 B
Python

from fastapi import HTTPException, status
class OpenChannelPushAmountError(HTTPException):
"""Raised when a the push amount is lower than the channel size."""
def __init__(self, local_funding, push_amt):
self.status_code = status.HTTP_400_BAD_REQUEST
self.detail = (
f"Push amount {push_amt} must be lower than "
f"local funding amount {local_funding}"
)
class NodeNotFoundError(HTTPException):
"""Raised when a node is not found in the graph."""
node_pub: str = ""
def __init__(self, node_pub=""):
self.status_code = status.HTTP_404_NOT_FOUND
self.detail = f"Node {node_pub} not found"
self.node_pub = node_pub