use axum::http::StatusCode; use problem_details::ProblemDetails; use std::fmt::Debug; use tracing::error; pub const ERROR_DETAILS_PATH_TRAVERSAL: &str = "You must not traverse!"; pub const ERROR_DETAILS_INTERNAL_ERROR: &str = "Internal Error! Check the logs of the backend service for details."; pub const ERROR_DETAILS_ABSOLUTE_PATH_NOT_ALLOWED: &str = "Absolute paths are not allowed."; pub const ERROR_DETAILS_NO_NAME_PROVIDED_MULTIPART_FIELD: &str = "No name provided for multipart form field"; pub fn to_internal_error(error: impl Debug) -> ProblemDetails { error!("{:?}", error); ProblemDetails::from_status_code(StatusCode::INTERNAL_SERVER_ERROR) .with_detail(ERROR_DETAILS_INTERNAL_ERROR) }