Skip to content

Commit

Permalink
community: Enhance Github error prompt (#15248)
Browse files Browse the repository at this point in the history
- **Description:** The Github error prompt is confused because of JWT
enctrypt to somebody not familiar with Github connection method. This PR
is to add some useful error prompt to help users troubleshooting.
- **Issue:**
#14550 (comment)
  - **Dependencies:** None,
  - **Twitter handle:** None
  • Loading branch information
triThirty authored Dec 28, 2023
1 parent d5e1725 commit fea4888
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libs/community/langchain_community/utilities/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ def validate_environment(cls, values: Dict) -> Dict:
"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)
Expand Down

0 comments on commit fea4888

Please sign in to comment.