$data = json_decode($res->getBody()->getContents());
} catch (RequestException $exception) {
$success = false;
+ $data = [];
Logger::notice('Request failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
- $data = json_decode($exception->getResponse()->getBody()->getContents());
}
return ['success' => $success, 'data' => $data];
}
$data = json_decode($res->getBody()->getContents());
} catch (RequestException $exception) {
$success = false;
- Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
$data = json_decode($exception->getResponse()->getBody()->getContents());
+ Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
}
return ['success' => $success, 'data' => $data];
}
\ No newline at end of file