Skip to content

Commit

Permalink
Properly handle invalid credential files
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
  • Loading branch information
coeuvre authored and copybara-github committed Jun 26, 2023
1 parent ed5e660 commit 4cf764d
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 4cf764d

Please sign in to comment.