/** * {@inheritdoc} */ public function formatException(HttpAdapterException $exception) { return array('code' => $exception->getCode(), 'message' => $exception->getMessage(), 'line' => $exception->getLine(), 'file' => $exception->getFile()); }
/** * Gets an array from an HttpAdapterException. * * @param HttpAdapterException $exception * * @return array */ public function exceptionToArray(HttpAdapterException $exception) { $array = ['code' => $exception->getCode(), 'message' => $exception->getMessage()]; if ($exception->hasRequest()) { $array['request'] = $this->internalRequestToArray($exception->getRequest()); } if ($exception->hasResponse()) { $array['response'] = $this->responseToArray($exception->getResponse()); } return $array; }