mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-29 11:31:41 +01:00
Replaced uncaught exceptions with BadRequestExceptions
These two errors could have caused confusion in the future
This commit is contained in:
parent
7480aa9d63
commit
86c4da43a5
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.djrapitops.plan.storage.database.queries.filter.filters;
|
||||
|
||||
import com.djrapitops.plan.delivery.web.resolver.exception.BadRequestException;
|
||||
import com.djrapitops.plan.storage.database.DBSystem;
|
||||
import com.djrapitops.plan.storage.database.queries.filter.Filter;
|
||||
import com.djrapitops.plan.storage.database.queries.filter.SpecifiedFilterInformation;
|
||||
@ -69,8 +70,8 @@ public abstract class DateRangeFilter implements Filter {
|
||||
}
|
||||
|
||||
private long getTime(SpecifiedFilterInformation query, String dateKey, String timeKey) {
|
||||
String date = query.get(dateKey).orElseThrow(IllegalArgumentException::new);
|
||||
String time = query.get(timeKey).orElseThrow(IllegalArgumentException::new);
|
||||
String date = query.get(dateKey).orElseThrow(() -> new BadRequestException("'" + dateKey + "' not specified in parameters for " + getKind()));
|
||||
String time = query.get(timeKey).orElseThrow(() -> new BadRequestException("'" + timeKey + "' not specified in parameters for " + getKind()));
|
||||
|
||||
try {
|
||||
return dateFormat.parse(date + ' ' + time).getTime();
|
||||
|
Loading…
Reference in New Issue
Block a user