Skip to content

Commit

Permalink
ACP-3738 Fixed Disconnect message. (#15)
Browse files Browse the repository at this point in the history
* ACP-3738: Fixed namespace

* ACP-3738: Fixed message to more abstract

* ACP-3738: Fixed test

* ACP-3670: Updated composer: app-webhook
  • Loading branch information
vol4onok authored Aug 23, 2024
1 parent 9be15f0 commit 691c91b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function postDisconnectAction(GlueRequestTransfer $glueRequestTransfer):
if (!$appConfigResponseTransfer->getIsSuccessful()) {
return $this->getFactory()
->createResponseBuilder()
->buildErrorResponse(AppKernelConfig::RESPONSE_MESSAGE_DISCONNECT_ERROR);
->buildErrorResponse($appConfigResponseTransfer->getErrorMessage() ?? AppKernelConfig::RESPONSE_MESSAGE_DISCONNECT_ERROR);
}

return $this->getFactory()->createResponseBuilder()->buildSuccessfulResponse();
Expand Down
6 changes: 3 additions & 3 deletions src/Spryker/Zed/AppKernel/Business/Writer/ConfigWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ConfigWriter implements ConfigWriterInterface
/**
* @var string
*/
protected const FAILED_TO_REGISTER_TENANT_MESSAGE = 'Tenant registration failed';
protected const TENANT_ACTION_FAILED_MESSAGE = 'Tenant action failed';

/**
* @param array<\Spryker\Zed\AppKernelExtension\Dependency\Plugin\ConfigurationBeforeSavePluginInterface> $configurationBeforeSavePlugins
Expand Down Expand Up @@ -59,14 +59,14 @@ public function saveConfig(AppConfigTransfer $appConfigTransfer): AppConfigRespo
return $this->getSuccessResponse($appConfigTransfer);
} catch (Throwable $throwable) {
$this->getLogger()->error(
static::FAILED_TO_REGISTER_TENANT_MESSAGE,
static::TENANT_ACTION_FAILED_MESSAGE,
[
'tenantIdentifier' => $appConfigTransfer->getTenantIdentifier(),
'exception' => $throwable,
],
);

return $this->getFailResponse(sprintf('%s: %s', static::FAILED_TO_REGISTER_TENANT_MESSAGE, $throwable->getMessage()));
return $this->getFailResponse(sprintf('%s: %s', static::TENANT_ACTION_FAILED_MESSAGE, $throwable->getMessage()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function assertGlueResponseContainsErrorMessageWhenExceptionWasThrown(Glu
$this->assertNotEmpty($contentData);
$this->assertEquals(1, count($contentData['errors']));
$this->assertEquals(
'Tenant registration failed: Something went wrong',
'Tenant action failed: Something went wrong',
$contentData['errors'][0]['message'],
);
}
Expand Down

0 comments on commit 691c91b

Please sign in to comment.