fix(H-Keyring): if getCache returns Error not EntryDoesNotExist, error #846
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
The Cache querying logic in the H-Keyring confuses a cache miss
with an opaque error.
i.e:
getCachOutput.Failure?
is not alwaysEntryDoesNotExist
but could be something likeOpaque(obj? := java.nio.BufferUnderflowException)
.Thus, I suggest we refactor the methods that call the cache to differentiate b/w Opaque and
EntryDoesNotExist
.For an explanation on why we should never catch and swallow all exceptions/errors,
see: https://stackoverflow.com/questions/2416316/why-is-the-catchexception-almost-always-a-bad-idea
Finally, the behavior of the H-Keyring is possibly better respected by such a change.
The H-Kerying's specification reads:
The specification does not say it MUST swallow all exceptions.
Squash/merge commit message, if applicable:
fix(H-Keyring): if getCache returns Opaque Error, return Opaque
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.