diff --git a/server.py b/server.py index 50979ae..8e5b000 100644 --- a/server.py +++ b/server.py @@ -391,7 +391,11 @@ class Anonymous_Github: repository_configuration = json.load(f) (username, repo, branch) = clean_github_repository(repository_configuration['repository']) g_repo = self.github.get_repo("%s/%s" % (username, repo)) - g_commit = g_repo.get_commit(branch) + g_commit = None + try: + g_commit = g_repo.get_commit(branch) + except: + return render_template('empty.html'), 404 if not is_up_to_date(repository_configuration, g_commit): if os.path.exists(os.path.join(repo_path, "cache")): diff --git a/templates/404.html b/templates/404.html index 9b535f5..441b7c5 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,3 +1,35 @@ - -
+ The repository that you try to access is empty or is not accessible. +
+ + \ No newline at end of file