Skip to content

Commit

Permalink
(fix) Validate the config upon client creation
Browse files Browse the repository at this point in the history
We only validated the settings in the ui, but it auto-upload mode, the
error message was weird. We better give something better to the user.
  • Loading branch information
nitriques committed Oct 12, 2023
1 parent 621cc42 commit 7c4ff6f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/CloudflareVideoStreamClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ class CloudflareVideoStreamClient

public function __construct(\deuxhuithuit\cfstream\models\Settings $config)
{
if (!$config->getApiToken()) {
throw new \Error('No API token found');
}
if (!$config->getAccountId()) {
throw new \Error('No account ID found');
}
$this->config = $config;
}

Expand Down

0 comments on commit 7c4ff6f

Please sign in to comment.