blitz_api/app/lightning/exceptions.py
fusion44 e290de8933
feat: proper error handling resolving peer aliases
Implementations sometimes don't find aliases in the gossip, even if
they are openeing a channel to the pubkey. In this case an empty
string will be returned and the problem logged in debug mode.

refs #199
2023-05-01 20:48:10 +02:00

12 lines
339 B
Python

from fastapi import HTTPException, status
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