Skip to content

Commit

Permalink
fix unexpected exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bouttier committed Aug 2, 2022
1 parent 39bc17c commit 504c069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apptax/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from flask_migrate import Migrate
from werkzeug.middleware.proxy_fix import ProxyFix
from sqlalchemy.exc import ProgrammingError
from sqlalchemy.orm.exc import NoResultFound

from apptax.database import db

Expand Down Expand Up @@ -68,7 +69,7 @@ def create_app():
from pypnusershub.db.models import Application

th_app = Application.query.filter_by(code_application="TH").one()
except ProgrammingError:
except (ProgrammingError, NoResultFound):
logging.warning(
"Warning: unable to find TaxHub application, database not yet initialized?"
)
Expand Down

0 comments on commit 504c069

Please sign in to comment.