From 558e8170daf9f11212c7167f74138e86d15b3eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C3=A9fir=20Destiny?= Date: Fri, 13 Dec 2019 10:43:01 +0100 Subject: [PATCH] Show connector error only on debug mode --- app.py | 2 +- connectors.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index f3a7a89..53fb808 100644 --- a/app.py +++ b/app.py @@ -2,7 +2,7 @@ from operator import itemgetter from flask import redirect, render_template, request, url_for -from config import app, auth, db, ADMIN_USERNAME, ADMIN_PASSWORD, APP_PORT, IS_DEBUG +from config import app, auth, db, ADMIN_USERNAME, ADMIN_PASSWORD, APP_PORT from connectors import * from models import AnimeFolder, AnimeTitle, DeleteForm, SearchForm, EditForm diff --git a/connectors.py b/connectors.py index 5799cb6..694c1e5 100644 --- a/connectors.py +++ b/connectors.py @@ -10,6 +10,7 @@ from sys import platform import requests from bs4 import BeautifulSoup +from config import IS_DEBUG from models import AnimeLink @@ -137,7 +138,8 @@ class Connector(ABC): except Exception as e: output = '' http_code = 500 - print(e) + if IS_DEBUG: + print(e) else: if ajax: headers = {'X-Requested-With': 'XMLHttpRequest'}