Add structured logging and centralized error handling
- Initialize slog in the serve command with terminal/file support - Introduce `AppError` with HTTP status for unified service-layer errors - Replace ad-hoc `api.Error` calls with `api.RespondError` - Wrap internal errors with `model.NewInternalError` and add reference IDs - Add `RequestID` middleware and switch router from `gin.Default` to `gin.New`
This commit is contained in:
@@ -70,7 +70,7 @@ func setupFileHandler(t *testing.T) *FileHandler {
|
||||
|
||||
fileRepo := repository.NewFileRepository(db)
|
||||
store := newInMemStore()
|
||||
fileService := service.NewFileService(fileRepo, store, 0)
|
||||
fileService := service.NewFileService(fileRepo, store, 0, nil)
|
||||
|
||||
return NewFileHandler(fileService)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user