Jelajahi Sumber

AssertionError,ConnectionResetError打印异常

locky 2 tahun lalu
induk
melakukan
b517982f4a
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      Service/PushService.py

+ 2 - 2
Service/PushService.py

@@ -133,8 +133,8 @@ class PushObject:
             res = cli.push(n=n, device_token=token_val, topic=app_bundle_id)
             logger.info('IOS推送响应状态码{},params,uid:{},{}'.format(res.status_code, uid, json.dumps(push_data)))
             assert res.status_code == 200
-        except (AssertionError, ConnectionResetError):
-            pass
+        except (AssertionError, ConnectionResetError) as e:
+            logger.info('IOS推送异常: {}, 证书路径: {}'.format(repr(e), pem_path))
         except Exception as e:
             logger.info('IOS推送异常: {}, 证书路径: {}'.format(repr(e), pem_path))
             email_content = '{}服IOS推送异常: {}, 证书路径: {}'.format(CONFIG_INFO, repr(e), pem_path)