File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,7 @@ class call this method to send HTTP requests out. Refer to
335335
336336 Raises:
337337 HTTPError: Any HTTPX exceptions encountered while making the HTTP call.
338+ RequestException: Any requests exceptions encountered while making the HTTP call.
338339 """
339340 if 'timeout' not in kwargs :
340341 kwargs ['timeout' ] = self .timeout
Original file line number Diff line number Diff line change @@ -533,13 +533,11 @@ async def send_data(data):
533533 url = self ._fcm_url ,
534534 headers = self ._fcm_headers ,
535535 json = data )
536- # HTTP/2 check
537- if resp .http_version != 'HTTP/2' :
538- raise Exception ('This messages was not sent with HTTP/2' )
539- resp .raise_for_status ()
540- # except httpx.HTTPStatusError as exception:
541536 except httpx .HTTPError as exception :
542537 return SendResponse (resp = None , exception = self ._handle_fcm_httpx_error (exception ))
538+ # Catch errors caused by the requests library during authorization
539+ except requests .exceptions .RequestException as exception :
540+ return SendResponse (resp = None , exception = self ._handle_fcm_error (exception ))
543541 else :
544542 return SendResponse (resp .json (), exception = None )
545543
You can’t perform that action at this time.
0 commit comments