-
Notifications
You must be signed in to change notification settings - Fork 13
Adding an aggregate exception class to the interface module to be use… #436
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
Conversation
…d to return back multiple exceptions from the metadata restoration logic.
| * @param objectName name of the file to be restored | ||
| * @param metadata metadata which needs to be set on local file | ||
| */ | ||
| private void restoreMetaData(final String objectName, final Metadata metadata) throws IOException, InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this method throw AggregateException now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not required since I made AggregateException extend RuntimeException.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
you don't want to add test for the new AggregateException? |
|
I probably should... |
| this.exceptions = exceptionList(exceptions); | ||
| } | ||
|
|
||
| private static List<Throwable> exceptionList(final Iterable<Throwable> exceptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the need to make a mutable copy of the iterable contents, since the getter returns an iterable. Though it's most likely not a big deal in terms of the amount of space used to make a copy, I'm wondering about the immutable -> mutable ness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason is I wanted to make sure that the iterable we return in the getter can be called multiple times. I wanted to make the list immutable, but we've not included guava in the interfaces module, which is why I made it with a mutable type.
…d to return back multiple exceptions from the metadata restoration logic.