Example #1
0
 /**
  * handleHttpClientError
  *
  * @param \Exception $exception
  *
  * @return mixed
  */
 public function handleHttpClientError(\Exception $exception)
 {
     if ($exception instanceof RequestException) {
         $error = $exception->getHandlerContext();
         $error['error_description'] = $exception->getMessage();
         return $error;
     }
     return ['error' => $exception->getCode(), 'error_description' => $exception->getMessage()];
 }