✨ Source Github: updated user error messages (#30927)
This commit is contained in:
@@ -149,11 +149,11 @@ class SourceGithub(AbstractSource):
|
||||
api_url_parsed = urlparse(config["api_url"])
|
||||
|
||||
if not api_url_parsed.scheme.startswith("http"):
|
||||
message = "Please enter a full URL starting with http..."
|
||||
message = "Please enter a full url for `API URL` field starting with `http`"
|
||||
elif api_url_parsed.scheme == "http" and not self._is_http_allowed():
|
||||
message = "HTTP connection is insecure and is not allowed in this environment. Please use `https` instead."
|
||||
elif not api_url_parsed.netloc:
|
||||
message = "Please provide a correct URL"
|
||||
message = "Please provide a correct API URL."
|
||||
else:
|
||||
return config
|
||||
|
||||
@@ -209,7 +209,7 @@ class SourceGithub(AbstractSource):
|
||||
elif "404 Client Error: Not Found for url: https://api.github.com/orgs/" in message:
|
||||
# 404 Client Error: Not Found for url: https://api.github.com/orgs/airbytehqBLA/repos?per_page=100
|
||||
org_name = message.split("https://api.github.com/orgs/")[1].split("/")[0]
|
||||
user_message = f'Organization name: "{org_name}" is unknown, "repository" config option should be updated'
|
||||
user_message = f'Organization name: "{org_name}" is unknown, "repository" config option should be updated. Please validate your repository config.'
|
||||
elif "401 Client Error: Unauthorized for url" in message:
|
||||
# 401 Client Error: Unauthorized for url: https://api.github.com/orgs/datarootsio/repos?per_page=100&sort=updated&direction=desc
|
||||
user_message = (
|
||||
@@ -253,6 +253,7 @@ class SourceGithub(AbstractSource):
|
||||
user_message = (
|
||||
"No streams available. Looks like your config for repositories or organizations is not valid."
|
||||
" Please, check your permissions, names of repositories and organizations."
|
||||
" Needed scopes: repo, read:org, read:repo_hook, read:user, read:discussion, workflow."
|
||||
)
|
||||
raise AirbyteTracedException(
|
||||
internal_message="No streams available. Please check permissions",
|
||||
|
||||
Reference in New Issue
Block a user