Skip to content

Different Exception Handlung GCM <> Apns? #191

@tbsmark86

Description

@tbsmark86

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());
             }
         }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions