Skip to content

Commit

Permalink
Fix incorrect exception if config is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel committed Apr 17, 2018
1 parent b94c1a9 commit 9c830e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions swaggertosdk/SwaggerToSdkNewCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,16 @@ def generate_sdk_from_git_object(git_object, branch_name, restapi_git_id, sdk_gi

# I don't know if the destination branch exists, try until it works
config = None
for branch in base_branch_names + [branch_name] + [fallback_base_branch_name]:
branch_list = base_branch_names + [branch_name] + [fallback_base_branch_name]
for branch in branch_list:
try:
config = read_config_from_github(sdk_git_id, branch)
except Exception:
pass
else:
break
if config is None:
raise ValueError("Unable to locate configuration in {}".format(base_branch_names + branch_name + fallback_base_branch_name))
raise ValueError("Unable to locate configuration in {}".format(branch_list))
global_conf = config["meta"]

with tempfile.TemporaryDirectory() as temp_dir:
Expand Down

0 comments on commit 9c830e4

Please sign in to comment.