Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cashu/mint/ledger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import time
import traceback
from typing import Dict, List, Mapping, Optional, Tuple

import bolt11
Expand Down Expand Up @@ -57,6 +58,7 @@
PaymentResponse,
PaymentResult,
PaymentStatus,
StatusResponse,
)
from ..mint.crud import LedgerCrudSqlite
from .conditions import LedgerSpendingConditions
Expand Down Expand Up @@ -179,7 +181,16 @@ async def _check_backends(self) -> None:
f"Using {self.backends[method][unit].__class__.__name__} backend for"
f" method: '{method.name}' and unit: '{unit.name}'"
)
status = await self.backends[method][unit].status()
try:
status = await self.backends[method][unit].status()
except Exception as e:
logger.debug(
f"Backend status check failed: {traceback.format_exc()}"
)
status = StatusResponse(
error_message=f"{type(e).__name__}: {e}",
balance=Amount(unit, 0),
)
Comment thread
KvngMikey marked this conversation as resolved.
Comment thread
KvngMikey marked this conversation as resolved.
if status.error_message:
logger.error(
"The backend for"
Expand Down
Loading