Added general exception handler for function 'import_nodewatcher_xml'

Signed-off-by: Steffen Pankratz <kratz00@gmx.de>
This commit is contained in:
Steffen Pankratz 2017-01-28 18:20:36 +01:00
parent 066eac5dd6
commit 4b09731360
No known key found for this signature in database
GPG Key ID: EA69A81F0D563809
1 changed files with 10 additions and 0 deletions

View File

@ -107,6 +107,16 @@ def import_nodewatcher_xml(mac, xml):
}})
status = "unknown"
status_comment = "Integer Overflow"
except Exception as e:
import traceback
print("Warning: Exception occurred when saving %s: %s\n__%s" % (mac, e, traceback.format_exc().replace("\n", "\n__")))
if router:
db.routers.update_one({"_id": router_id}, {"$set": {
"status": "unknown",
"last_contact": utcnow()
}})
status = "unknown"
status_comment = "Exception occurred"
if router_id:
# fire events