salesChannelInMaintenanceMode example

try {
            /** @var string[] $allowedIps */
            $allowedIps = Json::decodeToList((string) ($salesChannelData['maintenanceIpWhitelist'] ?? ''));
        } catch (UtilException $e) {
            return;
        }

        if ($this->maintenanceModeResolver->isClientAllowed($request$allowedIps)) {
            return;
        }

        throw ApiException::salesChannelInMaintenanceMode();
    }
}


    public function testInvalidAccessKeyIdentifier(): void
    {
        $exception = ApiException::invalidAccessKeyIdentifier();

        static::assertEquals(ApiException::API_INVALID_ACCESS_KEY_IDENTIFIER_EXCEPTION, $exception->getErrorCode());
    }

    public function testSalesChannelInMaintenanceMode(): void
    {
        $exception = ApiException::salesChannelInMaintenanceMode();

        static::assertEquals(ApiException::API_SALES_CHANNEL_MAINTENANCE_MODE, $exception->getErrorCode());
    }
}
Home | Imprint | This part of the site doesn't use cookies.