Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Stenzel <overheadhunter@users.noreply.github.com>
  • Loading branch information
infeo and overheadhunter committed Sep 15, 2023
1 parent b4827ff commit 0872aec
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ Optional<Map<String, KeychainEntry>> loadKeychainEntries(Path keychainPath) thro
try (InputStream in = Files.newInputStream(keychainPath, StandardOpenOption.READ); //
Reader reader = new InputStreamReader(in, UTF_8)) {
return Optional.ofNullable(JSON_MAPPER.readValue(reader, type));
} catch (NoSuchFileException | JacksonException e) {
if (e instanceof JacksonException) {
LOG.warn("Unable to parse keychain file, overwriting existing one.");
}
} catch (NoSuchFileException e) {
return Optional.empty();
} catch (JacksonException je) {
LOG.warn("Unable to parse keychain file, overwriting existing one.");
return Optional.empty();
} catch (IOException ioe) {
throw new KeychainAccessException("Could not read keychain from path " + keychainPath, ioe);
} catch (IOException e) {
throw new KeychainAccessException("Could not read keychain from path " + keychainPath, e);
}
}

Expand Down

0 comments on commit 0872aec

Please sign in to comment.