pengzhibo168 5 jaren geleden
bovenliggende
commit
6c2a08e1ef
1 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 6 6
      Controller/DetectController.py

+ 6 - 6
Controller/DetectController.py

@@ -345,7 +345,7 @@ class NotificationView(View):
 
     def do_apns(self, uid, channel, appBundleId, token_val, event_type, n_time, msg_title,
                 msg_text):
-        try:
+        # try:
             cli = apns2.APNSClient(mode=APNS_MODE,
                                    client_cert=os.path.join(BASE_DIR, APNS_CONFIG[appBundleId]['pem_path']))
             push_data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
@@ -363,11 +363,11 @@ class NotificationView(View):
                 print('apns push fail')
                 print(res.reason)
                 return
-        except (ValueError, ArithmeticError):
-            return 'The program has a numeric format exception, one of the arithmetic exceptions'
-        except Exception as e:
-            print(repr(e))
-            return repr(e)
+        # except (ValueError, ArithmeticError):
+        #     return 'The program has a numeric format exception, one of the arithmetic exceptions'
+        # except Exception as e:
+        #     print(repr(e))
+        #     return repr(e)
 
 
 # http://test.dvema.com/detect/add?uidToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJQMldOR0pSRDJFSEE1RVU5MTExQSJ9.xOCI5lerk8JOs5OcAzunrKCfCrtuPIZ3AnkMmnd-bPY&n_time=1526845794&channel=1&event_type=51&is_st=0