Skip to content

Commit

Permalink
Properly handle invalid credential files (#18779)
Browse files Browse the repository at this point in the history
to prevent Bazel sever from crashing.

The functions used to construct credentials could throw runtime exception which will crash Bazel server in which case the Bazel client will just exit silently.

Fixes #18755.

Closes #18770.

PiperOrigin-RevId: 543413376
Change-Id: I71238345f350caaac51f9cc9f654661a90cf6737

Co-authored-by: Chi Wang <[email protected]>
  • Loading branch information
iancha1992 and coeuvre authored Jun 27, 2023
1 parent 7541379 commit 28312a9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public static Credentials newGoogleCredentialsFromFile(
creds = creds.createScoped(authScopes);
}
return creds;
} catch (IOException e) {
} catch (Exception e) {
String message = "Failed to init auth credentials: " + e.getMessage();
throw new IOException(message, e);
}
Expand Down

0 comments on commit 28312a9

Please sign in to comment.