improve error message (#4141)

## Issue Addressed

NA

## Proposed Changes

Not use magic number directly in the error message.

## Additional Info

NA
This commit is contained in:
int88 2023-03-28 22:07:05 +00:00
parent 65d0f63639
commit d3c20ffa9d

View File

@ -77,8 +77,8 @@ pub fn get_attestation_performance<T: BeaconChainTypes>(
// query is within permitted bounds to prevent potential OOM errors. // query is within permitted bounds to prevent potential OOM errors.
if (end_epoch - start_epoch).as_usize() > MAX_REQUEST_RANGE_EPOCHS { if (end_epoch - start_epoch).as_usize() > MAX_REQUEST_RANGE_EPOCHS {
return Err(custom_bad_request(format!( return Err(custom_bad_request(format!(
"end_epoch must not exceed start_epoch by more than 100 epochs. start: {}, end: {}", "end_epoch must not exceed start_epoch by more than {} epochs. start: {}, end: {}",
query.start_epoch, query.end_epoch MAX_REQUEST_RANGE_EPOCHS, query.start_epoch, query.end_epoch
))); )));
} }