Skip to content

Commit

Permalink
removed unnescessary try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
feyruzb committed Jan 9, 2025
1 parent 0b9f8f9 commit d74bf7d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions web/server/codechecker_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,15 +1078,11 @@ def check_callback_url_format(provider_name, callback_url):
# checks the format of callback url
for provider_name, provider_data in oauth_config.items():
callback_url = provider_data.get('oauth_callback_url')
try:
if not check_callback_url_format(provider_name, callback_url):
raise ValueError("The callback url format is invalid.")
except ValueError as verr:
LOG.error(verr)
LOG.error("The callback url format is invalid."
"Please check the configuration file.")
# turns off the provider if the callback url is invalid
LOG.debug("Turning off the provider: %s", provider_name)
if not check_callback_url_format(provider_name, callback_url):
LOG.warning("The callback URL format is invalid for provider '%s'. "
"Please check the configuration file.", provider_name)
# Turn off the provider if the callback URL is invalid
LOG.warning("Turning off the provider: %s", provider_name)
provider_data['enabled'] = False
except IOError as ioerr:
LOG.debug(ioerr)
Expand Down

0 comments on commit d74bf7d

Please sign in to comment.