Skip to content

The agent engineering platform.

community: Enhance Github error prompt (#15248)

triThirtyfea4888e722a
diff --git a/libs/community/langchain_community/utilities/github.py b/libs/community/langchain_community/utilities/github.py
index e9929e451f..25d931bbce 100644
--- a/libs/community/langchain_community/utilities/github.py
+++ b/libs/community/langchain_community/utilities/github.py
@@ -85,7 +85,13 @@ class GitHubAPIWrapper(BaseModel):
"https://docs.github.com/en/apps/using-"
"github-apps/installing-your-own-github-app"
)
- installation = installation[0]
+ try:
+ installation = installation[0]
+ except ValueError as e:
+ raise ValueError(
+ "Please make sure to give correct github parameters "
+ f"Error message: {e}"
+ )
# create a GitHub instance:
g = installation.get_github_for_installation()
repo = g.get_repo(github_repository)