Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STUB] getObjectMetadata should also refine FileNotFoundException #386

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

tPl0ch
Copy link
Contributor

@tPl0ch tPl0ch commented Jan 15, 2023

While working on a use-case in which we first check for object existence via
getObjectMetadata before we use putObject in order to save bandwidth, I
realized that when using the test stub the tests were failing with an
NoSuchFileException.

This was due to the fact that getObjectMetadata does not refine the
NoSuchFileException like getObject does with FileNotFoundException.

This commit adds refinement of these exceptions to getObjectMetadata
analogous to getObject. The fileNotFound function needs to be adapted
to Throwable because java.nio.* and java.io.* do not share an error
hierarchy.

@tPl0ch tPl0ch requested a review from a team as a code owner January 15, 2023 15:46
@CLAassistant
Copy link

CLAassistant commented Jan 15, 2023

CLA assistant check
All committers have signed the CLA.

@tPl0ch tPl0ch force-pushed the ft-exception-type-stub branch 3 times, most recently from 4225e40 to 7591f4e Compare January 15, 2023 18:23
While working on a use-case in which we first check for object existence via
`getObjectMetadata` before we use `putObject` in order to save bandwidth, I
realized that when using the test stub the tests were failing with an
`NoSuchFileException`.

This was due to the fact that `getObjectMetadata` does not refine the
`NoSuchFileException` like `getObject` does with `FileNotFoundException`.

This commit adds refinement of these exceptions to `getObjectMetadata`
analogous to `getObject`. The `fileNotFound` function needs to be adapted
to `Throwable` because `java.nio.*` and `java.io.*` do not share an error
hierarchy.
@tPl0ch tPl0ch force-pushed the ft-exception-type-stub branch from 7591f4e to 393d1ab Compare January 16, 2023 19:13
@tPl0ch
Copy link
Contributor Author

tPl0ch commented Jan 17, 2023

@regis-leray I guess you also need to approve the CI workflows since I am a first time contributor.

@regis-leray regis-leray merged commit 095a594 into zio:series/2.x Jan 27, 2023
@tPl0ch tPl0ch deleted the ft-exception-type-stub branch January 28, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants