Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Move utility scripts (countpieces, encrypt, decrypt) from the root into a new 'scripts/' directory.

This improves project organization by separating developer tooling from core application code.

Note: Discovered pre-existing test failures in 'name-anonymizer.test.ts' and 'ai-template.test.ts' during verification. The root cause in 'ai-template.ts' appears to be a complex bug in the template preprocessing logic. Reverted attempts to fix these tests to keep this commit focused on the refactoring.

I've moved the utility scripts (countpieces, encrypt, decrypt) from the root into a new 'scripts/' directory.

This should improve the project's organization by separating developer tooling from the core application code.

As a side note, while verifying my changes, I discovered pre-existing test failures in 'name-anonymizer.test.ts' and 'ai-template.test.ts'. The root cause in 'ai-template.ts' seems to be a complex bug in the template preprocessing logic. I reverted my attempts to fix these tests to keep this change focused on the refactoring.
@vercel
Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
apoia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 6:28pm

Introduces a standardized, robust error handling strategy for API routes.

- Creates a new utility module 'lib/utils/api-error.ts' with helper functions and custom error classes (ApiError, NotFoundError, etc.).
- Implements a higher-order function 'withErrorHandler' to wrap API routes, providing centralized try-catch logic, consistent error response bodies ({ "error": "..." }), and semantically correct HTTP status codes.
- Refactors the GET /api/v1/process/{number} endpoint as a proof-of-concept for the new strategy.

This change improves maintainability, security, and provides a better experience for API clients.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant