exception-filters
NestJS Exception Filters
When to Use This Skill
Use this skill when:
- Customizing error response format
- Logging exceptions for monitoring and debugging
- Handling specific exception types differently
- Converting third-party library errors to HTTP exceptions
- Implementing custom error handling logic
- Providing user-friendly error messages
- Adding metadata to error responses (request ID, timestamp)
- Catching all unhandled exceptions
What are Exception Filters?
Exception filters handle exceptions thrown during request processing. They can catch specific exception types or all exceptions, and customize the error response sent to the client.
NestJS has a built-in global exception filter that handles all unhandled exceptions. Custom filters allow you to override or extend this behavior.
More from ramziddin/ccplugins
security
NestJS security best practices including CORS, CSRF protection, Helmet for HTTP headers, rate limiting, encryption, and hashing. Use when implementing security features, hardening applications, or protecting against common vulnerabilities.
3authentication
NestJS authentication with JWT, Passport, local/JWT strategies, and auth guards. Use when implementing user login, token generation, protected routes, or integrating authentication systems.
3caching
NestJS caching with cache module, in-memory caching, Redis integration, cache interceptor, and TTL management. Use when implementing performance optimization, reducing database queries, or storing temporary data.
2cli
NestJS CLI for generating resources, managing workspaces, building applications, and development commands. Use when scaffolding NestJS projects, generating boilerplate code, or managing monorepo structures.
2testing
NestJS unit and E2E testing with Test.createTestingModule(), mocking dependencies, testing best practices, and integration testing strategies. Use when writing tests for controllers, services, or full application flows.
2controllers
NestJS controllers for handling HTTP requests, routing, route parameters, query parameters, request payloads, and responses. Use when creating API endpoints, handling HTTP methods, or working with request/response objects.
2