File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ impl PaginationOptionsBuilder {
103103 && is_useragent_or_ip_blocked ( config, req)
104104 {
105105 req. request_log ( ) . add ( "cause" , "large page offset" ) ;
106- return Err ( bad_request ( "requested page offset is too large" ) ) ;
106+
107+ let error =
108+ format ! ( "Page {numeric_page} is unavailable for performance reasons. Please take a look at https://crates.io/data-access for alternatives." ) ;
109+
110+ return Err ( bad_request ( error) ) ;
107111 }
108112 }
109113
Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ fn pagination_blocks_ip_from_cidr_block_list() {
2424 assert_eq ! ( response. status( ) , StatusCode :: BAD_REQUEST ) ;
2525 assert_eq ! (
2626 response. into_json( ) ,
27- json!( { "errors" : [ { "detail" : "requested page offset is too large " } ] } )
27+ json!( { "errors" : [ { "detail" : "Page 2 is unavailable for performance reasons. Please take a look at https://crates.io/data-access for alternatives. " } ] } )
2828 ) ;
2929}
You can’t perform that action at this time.
0 commit comments