don't crash if btcpay key is invalid: log warning msg

This commit is contained in:
forest 2021-06-27 10:46:48 -05:00
parent ebf338eb12
commit 3cb6992359

View File

@ -5,6 +5,7 @@ import atexit
import os import os
import hashlib import hashlib
import requests import requests
import sys
import stripe import stripe
from dotenv import load_dotenv, find_dotenv from dotenv import load_dotenv, find_dotenv
@ -15,6 +16,8 @@ from flask import url_for
from flask import current_app from flask import current_app
from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.schedulers.background import BackgroundScheduler
from capsulflask.shared import my_exec_info_message
from capsulflask import hub_model, spoke_model, cli from capsulflask import hub_model, spoke_model, cli
from capsulflask.btcpay import client as btcpay from capsulflask.btcpay import client as btcpay
from capsulflask.http_client import MyHTTPClient from capsulflask.http_client import MyHTTPClient
@ -130,7 +133,7 @@ app.config['HTTP_CLIENT'] = MyHTTPClient(timeout_seconds=int(app.config['INTERNA
try: try:
app.config['BTCPAY_CLIENT'] = btcpay.Client(api_uri=app.config['BTCPAY_URL'], pem=app.config['BTCPAY_PRIVATE_KEY']) app.config['BTCPAY_CLIENT'] = btcpay.Client(api_uri=app.config['BTCPAY_URL'], pem=app.config['BTCPAY_PRIVATE_KEY'])
except: except:
pass app.logger.warning("unable to create btcpay client: " + my_exec_info_message(sys.exc_info()))
if app.config['HUB_MODE_ENABLED']: if app.config['HUB_MODE_ENABLED']: