feat: vertical slice — migrations, postgres adapters, presentation handlers, bootstrap wiring
This commit is contained in:
@@ -44,12 +44,10 @@ impl FileStoragePort for LocalFileStorage {
|
||||
|
||||
async fn read_file(&self, path: &str) -> Result<Bytes, DomainError> {
|
||||
let full = self.resolve(path)?;
|
||||
let data = tokio::fs::read(&full)
|
||||
.await
|
||||
.map_err(|e| match e.kind() {
|
||||
std::io::ErrorKind::NotFound => DomainError::NotFound(path.to_string()),
|
||||
_ => DomainError::Internal(format!("Failed to read file: {e}")),
|
||||
})?;
|
||||
let data = tokio::fs::read(&full).await.map_err(|e| match e.kind() {
|
||||
std::io::ErrorKind::NotFound => DomainError::NotFound(path.to_string()),
|
||||
_ => DomainError::Internal(format!("Failed to read file: {e}")),
|
||||
})?;
|
||||
Ok(Bytes::from(data))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user