Skip to content

Commit cd9d014

Browse files
committed
Fix error messages
1 parent 169b91d commit cd9d014

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/labrinth/src/routes/v3/analytics_get.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,15 @@ async fn get(
432432
let full_time_range = req.time_range.end - req.time_range.start;
433433
if full_time_range < TimeDelta::zero() {
434434
return Err(ApiError::InvalidInput(
435-
"end date must be after start date".into(),
435+
"End date must be after start date".into(),
436436
));
437437
}
438438

439439
let (num_time_slices, resolution) = match req.time_range.resolution {
440440
TimeRangeResolution::Slices(slices) => {
441441
let slices = i32::try_from(slices.get()).map_err(|_| {
442442
ApiError::InvalidInput(
443-
"number of slices must fit into an `i32`".into(),
443+
"Number of slices must fit into an `i32`".into(),
444444
)
445445
})?;
446446
let resolution = full_time_range / slices;
@@ -450,12 +450,12 @@ async fn get(
450450
let resolution_minutes = i64::try_from(resolution_minutes.get())
451451
.map_err(|_| {
452452
ApiError::InvalidInput(
453-
"resolution must fit into a `u64`".into(),
453+
"Resolution must fit into a `i64`".into(),
454454
)
455455
})?;
456456
let resolution = TimeDelta::try_minutes(resolution_minutes)
457457
.ok_or_else(|| {
458-
ApiError::InvalidInput("resolution overflow".into())
458+
ApiError::InvalidInput("Resolution overflow".into())
459459
})?;
460460

461461
let num_slices =
@@ -467,12 +467,12 @@ async fn get(
467467

468468
if num_time_slices > MAX_TIME_SLICES {
469469
return Err(ApiError::InvalidInput(format!(
470-
"resolution is too fine or range is too large - maximum of {MAX_TIME_SLICES} time slices, was {num_time_slices}"
470+
"Resolution is too fine or range is too large - maximum of {MAX_TIME_SLICES} time slices, was {num_time_slices}"
471471
)));
472472
}
473473
if resolution < MIN_RESOLUTION {
474474
return Err(ApiError::InvalidInput(format!(
475-
"resolution must be at least {MIN_RESOLUTION}, was {resolution}",
475+
"Resolution must be at least {MIN_RESOLUTION}, was {resolution}",
476476
)));
477477
}
478478

0 commit comments

Comments
 (0)