Skip to content

Commit

Permalink
Fix handle integration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsykun committed Sep 26, 2023
1 parent 876980d commit e810948
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Controller/Api/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@ protected function receiveIntegrationHook(Request $request, OAuthIntegration $oa
}

$job = AppUtils::createLogJob($request, $oauth);
$response = $app = null;
$response = null;
try {
$app = $this->integrations->findApp($oauth->getAlias());
$response = $app->receiveHooks($oauth, $request, $this->getJsonPayload($request));
$client = $this->integrations->findApp($oauth->getAlias());
$response = $client->receiveHooks($oauth, $request, $this->getJsonPayload($request));
$job->setStatus(Job::STATUS_COMPLETED);
} catch (\Throwable $e) {
$error = AppUtils::castError($e, $app, true);
$error = AppUtils::castError($e, $oauth, true);
$this->logger->error($error, ['e' => $e]);

$job->setStatus(Job::STATUS_ERRORED);
Expand Down

0 comments on commit e810948

Please sign in to comment.