-
Notifications
You must be signed in to change notification settings - Fork 182
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
Throw exception if contentResolver.query() returns null #451
Conversation
Closes #451, also closes #448. |
Hm:
|
/** | ||
* {@inheritDoc} | ||
*/ | ||
public StorIOException(String detailMessage) { |
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.
@NonNull
for `detailMessage.
LGTM, but comments and test failure |
@artem-zinnatullin updated ;) |
/** | ||
* Common {@link RuntimeException} for all errors and exceptions occurred during StorIO operations. | ||
*/ | ||
public class StorIOException extends 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.
Nice!
return deleteResolver.performDelete(storIOContentResolver, deleteQuery); | ||
try { | ||
return deleteResolver.performDelete(storIOContentResolver, deleteQuery); | ||
} catch (Throwable throwable) { |
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.
Hm, you think we should wrap all Throwables
into StorIOException
? I'd expect only Exceptions
. Imagine if poorly written app used a lot of memory and performing operation in StorIO produces OutOfMemoryError
— I don't want to see reports about such problems in our issues tracker 😄
Let's catch only Exception
?
LGTM 👍 The only issue — |
@artem-zinnatullin Updated again) |
Nice, thanks! |
Throw exception if contentResolver.query() returns null, Add StorIOException
Also add custom exception.