Skip to content

Commit

Permalink
squash! Wrap IllegalArgumentException thrown by Base64 decoder
Browse files Browse the repository at this point in the history
Better error messages in OpenSSHKeyFileUtil and PuTTYKeyFile
  • Loading branch information
vladimirlagunov committed Apr 9, 2024
1 parent 6ad7e1e commit ce1cab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static ParsedPubKey initPubKey(Reader publicKey) throws IOException {
}
throw new IOException("Public key file is blank");
} catch (Base64DecodingException err) {
throw new IOException("Public Key decoding failed: " + err.getMessage(), err);
throw new IOException("Public key decoding failed", err);
} finally {
br.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected void parseKeyPair() throws IOException {
}
}
catch (Base64DecodingException e) {
throw new IOException("Corrupted PuTTY key: " + e.getMessage(), e);
throw new IOException("PuTTY key decoding failed", e);
}
}

Expand Down

0 comments on commit ce1cab2

Please sign in to comment.