Skip to content

Commit

Permalink
Use specific AnalysisServerException
Browse files Browse the repository at this point in the history
BAD_REQUEST instead of UNKNOWN
  • Loading branch information
ansoncfit committed Dec 29, 2023
1 parent 06e479f commit 9690d9d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ public MultiOriginAssembler (RegionalAnalysis regionalAnalysis, Job job, FileSto
int nODPairs = task.oneToOne ? nOriginsTotal : nOriginsTotal * nDestinations;
if (task.recordTimes &&
(nDestinations > MAX_FREEFORM_DESTINATIONS || nODPairs > MAX_FREEFORM_OD_PAIRS)) {
throw new AnalysisServerException(String.format(
throw AnalysisServerException.badRequest(String.format(
"Travel time results limited to %d destinations and %d origin-destination pairs.",
MAX_FREEFORM_DESTINATIONS, MAX_FREEFORM_OD_PAIRS
));
}
if (task.includePathResults &&
(nDestinations > PathResult.MAX_PATH_DESTINATIONS || nODPairs > MAX_FREEFORM_OD_PAIRS)) {
throw new AnalysisServerException(String.format(
throw AnalysisServerException.badRequest(String.format(
"Path results limited to %d destinations and %d origin-destination pairs.",
PathResult.MAX_PATH_DESTINATIONS, MAX_FREEFORM_OD_PAIRS
));
Expand Down

0 comments on commit 9690d9d

Please sign in to comment.