Skip to content

Commit 028765a

Browse files
committed
Report the GitHub auth token failure in the error
1 parent 305e0f6 commit 028765a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pullpal",
3-
"version": "0.1.0",
3+
"version": "0.0.1",
44
"description": "A fast, local PR review dashboard",
55
"type": "module",
66
"bin": {

src/api/api.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ function getGitHubToken(): string {
1414
try {
1515
cachedToken = execSync("gh auth token", { encoding: "utf-8" }).trim();
1616
return cachedToken;
17-
} catch {
18-
throw new Error(
19-
"Failed to get GitHub token. Make sure gh CLI is authenticated: gh auth login"
20-
);
17+
} catch (err) {
18+
throw new Error("Failed to get GitHub token. Make sure gh CLI is authenticated: "+ (err as Error).message, {
19+
cause: err,
20+
});
2121
}
2222
}
2323

@@ -186,9 +186,9 @@ const api = new Hono()
186186
isResolved: thread.isResolved,
187187
resolvedBy: thread.resolvedBy
188188
? {
189-
login: thread.resolvedBy.login,
190-
avatar_url: thread.resolvedBy.avatarUrl,
191-
}
189+
login: thread.resolvedBy.login,
190+
avatar_url: thread.resolvedBy.avatarUrl,
191+
}
192192
: null,
193193
});
194194
}

0 commit comments

Comments
 (0)