Skip to content

Commit 63d2da0

Browse files
committed
fix(api): enhance unauthorized error message to include API key details
1 parent f0d5751 commit 63d2da0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/lib/api.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ export async function fetchLibraryDocumentation(
120120
return errorMessage;
121121
}
122122
if (errorCode === 401) {
123-
const errorMessage = "Unauthorized. Please check your API key.";
123+
const errorMessage =
124+
"Unauthorized. Please check your API key. The API key you provided (possibly incorrect) is: " +
125+
apiKey +
126+
". API keys should start with 'ctx7sk'";
124127
console.error(errorMessage);
125128
return errorMessage;
126129
}

0 commit comments

Comments
 (0)