Skip to content

Commit b03f48b

Browse files
docs(exception-filters) Update exception-filters.md
Add documentation to caveat when using catch all filter with an other type specific filter based on issue #9696
1 parent f4365fb commit b03f48b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

content/exception-filters.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,21 @@ export class AllExceptionsFilter implements ExceptionFilter {
347347
}
348348
```
349349

350+
> warning **Warning** When combining an exception filter that catches everything with a filter that is bound to a specific type, the Catch-Anything filter should be declared first to allow the specific filter to correctly handle the bound type
351+
352+
353+
##### Catch-Anything Example
354+
355+
```
356+
// wrong
357+
app.useGlobalFilters(new MySpecificFilter(), new CatchAllFilter())
358+
// right
359+
app.useGlobalFilters(new CatchAllFilter(), new MySpecificFilter())
360+
```
361+
362+
See #9696 for details.
363+
364+
350365
#### Inheritance
351366

352367
Typically, you'll create fully customized exception filters crafted to fulfill your application requirements. However, there might be use-cases when you would like to simply extend the built-in default **global exception filter**, and override the behavior based on certain factors.

0 commit comments

Comments
 (0)