Skip to content

Commit 998172e

Browse files
authored
fix(auth-status): Handle malformed gitguardian.yaml on authentication (#35)
1 parent c4f2166 commit 998172e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/ggshield-api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ export function ggshieldAuthStatus(
276276
): boolean {
277277
const proc = runGGShieldCommand(configuration, ["api-status"]);
278278
if (proc.stderr || proc.error) {
279+
if (proc.stderr.includes("Config key")){
280+
window.showErrorMessage(`Gitguardian: ${proc.stderr}`);
281+
}
279282
console.log(proc.stderr);
280283
return false;
281284
} else {

src/lib/ggshield-resolver.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ export class GGShieldResolver {
7373
`API key provided in settings is invalid.`
7474
);
7575
}
76-
throw new Error(
77-
`Configuration provided in settings is invalid: ${proc.stderr}`
78-
);
7976
} else {
8077
this.configuration = configuration;
8178
return;

0 commit comments

Comments
 (0)