Closed gbgelado closed 6 years ago
How can I resolve this?
I do this to not stop to work on OneSignal Class
public function request($method, $uri, array $headers = [], $body = null) { try { $response = $this->client->send($method, self::API_URL.$uri, array_merge([ 'Content-Type' => 'application/json', ], $headers), $body); return json_decode($response->getBody(), true); } catch (\Exception $e) { $response = $e->getResponse(); return [ 'status' => 'error', 'message' => $e->getMessage(), 'statusCode' => $response->getStatusCode(), ]; } }
I don't understand your problem, could you explain further?
You could just catch exception and then do what you want if this is the case
How can I resolve this?
I do this to not stop to work on OneSignal Class