Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACP-3738 Fixed Disconnect message. #15

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 FAILED_TO_OPERATION_TENANT_MESSAGE = 'Tenant operation failed';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected const FAILED_TO_OPERATION_TENANT_MESSAGE = 'Tenant operation failed';
protected const FAILED_TENANT_ACTION_MESSAGE = 'Tenant action failed';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant is not in correct English. Should be TENANT_OPERATION_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::FAILED_TO_OPERATION_TENANT_MESSAGE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the message is generic here if the method is saveConfig()?
So "Failed to save tenant configuration." is more suitable here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it processes connect, new, disconnect statuses. you can check doSaveAppConfig

[
'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::FAILED_TO_OPERATION_TENANT_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 operation failed: Something went wrong',
$contentData['errors'][0]['message'],
);
}
Expand Down
Loading