fix some of mypy complaints.

This commit is contained in:
fiatjaf
2021-04-10 18:06:41 -03:00
parent fdf4f6c1ae
commit e38b945d5c
4 changed files with 27 additions and 27 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ async def create_bleskomat_lnurl(
return bleskomat_lnurl
async def get_bleskomat_lnurl(secret: str) -> BleskomatLnurl:
async def get_bleskomat_lnurl(secret: str) -> Optional[BleskomatLnurl]:
hash = generate_bleskomat_lnurl_hash(secret)
row = await db.fetchone("SELECT * FROM bleskomat_lnurls WHERE hash = ?", (hash,))
return BleskomatLnurl(**row) if row else None
+2 -2
View File
@@ -91,8 +91,8 @@ class BleskomatLnurl(NamedTuple):
wallet_id=self.wallet,
payment_request=query["pr"],
)
except Exception as exc:
raise LnurlValidationError(f"Failed to pay invoice: {exc.message}")
except Exception:
raise LnurlValidationError("Failed to pay invoice")
if not payment_hash:
raise LnurlValidationError("Failed to pay invoice")