]> git.lizzy.rs Git - cheatdb.git/commitdiff
Improve error messages
authorrubenwardy <rw@rubenwardy.com>
Sat, 11 Apr 2020 13:51:10 +0000 (14:51 +0100)
committerrubenwardy <rw@rubenwardy.com>
Sat, 11 Apr 2020 13:51:10 +0000 (14:51 +0100)
app/blueprints/github/__init__.py

index 7477238e94418d1f47b6bdf126bc0d26bae091af..b61baacecca02576c6fa68b10c22aefbe5f3ce28 100644 (file)
@@ -92,7 +92,7 @@ def webhook():
        github_url = "github.com/" + json["repository"]["full_name"]
        package = Package.query.filter(Package.repo.like("%{}%".format(github_url))).first()
        if package is None:
-               return error(400, "Unknown package")
+               return error(400, "Could not find package, did you set the VCS repo in CDB correctly?")
 
        # Get all tokens for package
        possible_tokens = APIToken.query.filter_by(package=package).all()
@@ -118,7 +118,7 @@ def webhook():
                        break
 
        if actual_token is None:
-               return error(403, "Invalid authentication")
+               return error(403, "Invalid authentication, couldn't validate API token. Make sure to limit token to a package")
 
        if not package.checkPerm(actual_token.owner, Permission.APPROVE_RELEASE):
                return error(403, "Only trusted members can use webhooks")