Skip to content

Commit

Permalink
#158: #159: "Filter with Invalid Date on ScreenRotation" not a bug. C…
Browse files Browse the repository at this point in the history
…hanged from log-error to log-info
  • Loading branch information
k3b committed Feb 6, 2020
1 parent 9c7eb43 commit 896883c
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,19 @@ private void toGui(IGalleryFilter gf) {
mFilterValue.showAdditionalSqlWhere();
}

private boolean fromGui(IGalleryFilter dest) {
try {
if (dest != null) {
dest.get(mFilterValue);
}
return true;
} catch (RuntimeException ex) {
Log.i(Global.LOG_CONTEXT, mDebugPrefix + ex.getMessage(), ex);
Toast.makeText(this, ex.getMessage(), Toast.LENGTH_LONG).show();
return false;
}
}

/** gui content seen as IGalleryFilter */
private class FilterValue implements IGalleryFilter {
final private java.text.DateFormat isoDateformatter = new SimpleDateFormat(
Expand Down Expand Up @@ -727,7 +740,7 @@ private long convertDate(String string) throws RuntimeException {
try {
return this.isoDateformatter.parse(string).getTime();
} catch (Exception ex) {
throw new RuntimeException(getString(R.string.filter_err_invalid_date_format, string), ex);
throw new IllegalArgumentException(getString(R.string.filter_err_invalid_date_format, string));
}
}

Expand All @@ -737,19 +750,6 @@ private long convertDate(String string) throws RuntimeException {

}

private boolean fromGui(IGalleryFilter dest) {
try {
if (dest != null) {
dest.get(mFilterValue);
}
return true;
} catch (RuntimeException ex) {
Log.e(Global.LOG_CONTEXT, mDebugPrefix + ex.getMessage(), ex);
Toast.makeText(this, ex.getMessage(), Toast.LENGTH_LONG).show();
return false;
}
}

private void cmdShowDetails() {
final QueryParameter asMergedQuery = getAsMergedQuery();

Expand Down

0 comments on commit 896883c

Please sign in to comment.