NotificationPusher icon indicating copy to clipboard operation
NotificationPusher copied to clipboard

Different Exception Handlung GCM <> Apns?

Open tbsmark86 opened this issue 4 years ago • 0 comments

Hi, due to live-server problems i've noted that GCM errors get a "PushException" while Apns Error just throw something deep down the zend framework. I propose to handle it the same as in gcm.php:

--- a/vendor_patches/sly/notification-pusher/src/Sly/NotificationPusher/Adapter/Apns.php
+++ b/vendor_patches/sly/notification-pusher/src/Sly/NotificationPusher/Adapter/Apns.php
@@ -23,6 +23,7 @@ use ZendService\Apple\Apns\Client\Message as ServiceClient;
 use ZendService\Apple\Apns\Message as ServiceMessage;
 use ZendService\Apple\Apns\Message\Alert as ServiceAlert;
 use ZendService\Apple\Apns\Response\Message as ServiceResponse;
+use ZendService\Apple\Exception\RuntimeException as ServiceRuntimeException;
·
 /**
  * APNS adapter.
@@ -96,7 +97,7 @@ class Apns extends BaseAdapter implements FeedbackAdapterInterface
·
                 $this->response->addOriginalResponse($device, $response);
                 $this->response->addParsedResponse($device, $responseArr);
-            } catch (\RuntimeException $e) {
+            } catch (ServiceRuntimeException $e) {
                 throw new PushException($e->getMessage());
             }
         }

tbsmark86 avatar Apr 24 '20 14:04 tbsmark86