Skip to content

Commit

Permalink
Throw Error on failing file_get_contents($plugin->getConf('openidurl'…
Browse files Browse the repository at this point in the history
…)); (#6)

It took me quite a while to debug. Finally it was a proxy issue.

But please to not silence errors and continue execution. Throw the errors. Thank you.
  • Loading branch information
fjf2002 committed Aug 16, 2023
1 parent 28892ed commit c7829fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Keycloak.php
Expand Up @@ -41,7 +41,7 @@ public function getEndpoint(string $endpoint)
if (!isset($this->discovery)) {
$plugin = plugin_load('helper', 'oauthkeycloak');
$json = file_get_contents($plugin->getConf('openidurl'));
if (!$json) return '';
if (!$json) throw new \Exception('Failed accessing ' . $plugin->getConf('openidurl'));
$this->discovery = json_decode($json, true);
}
if (!isset($this->discovery[$endpoint])) return '';
Expand Down

0 comments on commit c7829fa

Please sign in to comment.