Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
fix: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
taco-paco committed Oct 18, 2024
1 parent b5944e5 commit 95da4d4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/lambdas/src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ use lambda_http::{
run, service_fn, Error as LambdaError, Request as LambdaRequest, Response as LambdaResponse,
};
use serde::Deserialize;
use tracing::{error};
use tracing::error;
use types::item::errors::ItemError;
use types::item::task_result::TaskResult;
use types::{
item::{Item, Status},
};
use types::item::{Item, Status};
use uuid::Uuid;

const TABLE_NAME_DEFAULT: &str = "zksync-table";
Expand Down Expand Up @@ -43,7 +41,6 @@ async fn process_request(
.map_err(Box::new)?;

let raw_item = output.item.ok_or_else(|| {
error!("No objects in folder: {}", request.id);
let response = LambdaResponse::builder()
.status(StatusCode::NOT_FOUND)
.header("content-type", "text/html")
Expand All @@ -57,6 +54,7 @@ async fn process_request(
})?;

let item: Item = raw_item.try_into().map_err(|err: ItemError| {
error!("Failed to deserialize item. id: {}", request.id);
let response = LambdaResponse::builder()
.status(StatusCode::INTERNAL_SERVER_ERROR)
.header("content-type", "text/html")
Expand Down

0 comments on commit 95da4d4

Please sign in to comment.