This introduces a NoSuchAlgorithmRuntimeException to take the place of NoSuchAlgorithmException. The rationale is that, in virtually all cases, a NoSuchAlgorithmException is practically impossible because all JVMs are required to support SHA-1 and SHA-256. The one exception is SHA-512, which JVMs are not required to support (but most do).
Re-throwing NoSuchAlgorithmException as a NoSuchAlgorithmRuntimeException means that callers don't need to catch an exception that can never happen in most cases; in the one case where it can happen, we'll rely on the docs to warn callers that they should be on the lookout for a NoSuchAlgorithmRuntimeException.
My hope is that this is a worthwhile tradeoff in favor of API ergonomics, but I welcome feedback!
This introduces a
NoSuchAlgorithmRuntimeException
to take the place ofNoSuchAlgorithmException
. The rationale is that, in virtually all cases, aNoSuchAlgorithmException
is practically impossible because all JVMs are required to support SHA-1 and SHA-256. The one exception is SHA-512, which JVMs are not required to support (but most do).Re-throwing
NoSuchAlgorithmException
as aNoSuchAlgorithmRuntimeException
means that callers don't need to catch an exception that can never happen in most cases; in the one case where it can happen, we'll rely on the docs to warn callers that they should be on the lookout for aNoSuchAlgorithmRuntimeException
.My hope is that this is a worthwhile tradeoff in favor of API ergonomics, but I welcome feedback!