diff --git a/thermostat.py b/thermostat.py index 44f883e..9d2018b 100644 --- a/thermostat.py +++ b/thermostat.py @@ -197,7 +197,7 @@ class Set_mode_thermostat(Resource): db.session.add(data) db.session.commit() return "OK", 201 - except sqlite3.IntegrityError: + except sqlalchemy.exc.IntegrityError as e: logging.error("catched") return "K0", 400 except Exception as e: