Skip to content

Commit a59d4f3

Browse files
remove unnecessary format conversion on error messages
1 parent a3e0aad commit a59d4f3

File tree

1 file changed

+3
-5
lines changed
  • aggregation_mode/batcher/src/server

1 file changed

+3
-5
lines changed

aggregation_mode/batcher/src/server/http.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,14 @@ impl BatcherServer {
111111
{
112112
Ok(receipts) => receipts.len(),
113113
Err(_) => {
114-
return HttpResponse::InternalServerError().json(AppResponse::new_unsucessfull(
115-
format!("Internal server error").as_str(),
116-
500,
117-
))
114+
return HttpResponse::InternalServerError()
115+
.json(AppResponse::new_unsucessfull("Internal server error", 500))
118116
}
119117
};
120118

121119
if daily_tasks_by_address >= MAX_PROOFS_PER_DAY {
122120
return HttpResponse::InternalServerError().json(AppResponse::new_unsucessfull(
123-
format!("Request denied: Query limit exceeded.").as_str(),
121+
"Request denied: Query limit exceeded.",
124122
400,
125123
));
126124
}

0 commit comments

Comments
 (0)