Skip to content

Commit 720f04b

Browse files
update(@nestjs/common) remove deprecated exception filters decorator
1 parent 79d646f commit 720f04b

3 files changed

Lines changed: 7 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.1.4
2+
- **common**: remove deprecated `@ExceptionFilters()` decorator
3+
14
## 4.1.3
25
- **core**: forward reference bugfixes & security updates
36

src/common/test/utils/exception-filters.decorator.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import 'reflect-metadata';
22
import { expect } from 'chai';
33
import { EXCEPTION_FILTERS_METADATA } from '../../constants';
4-
import { ExceptionFilters } from '../../utils/decorators/exception-filters.decorator';
4+
import { UseFilters } from '../../utils/decorators/exception-filters.decorator';
55

6-
describe('@ExceptionFilters', () => {
6+
describe('@UseFilters', () => {
77
const filters = [ 'exception', 'exception2' ];
88

9-
@ExceptionFilters(...filters as any) class Test {}
9+
@UseFilters(...filters as any) class Test {}
1010

1111
class TestWithMethod {
12-
@ExceptionFilters(...filters as any)
12+
@UseFilters(...filters as any)
1313
public static test() {}
1414
}
1515

src/common/utils/decorators/exception-filters.decorator.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ const defineFiltersMetadata = (...filters: ExceptionFilter[]) => {
1414
};
1515
};
1616

17-
/**
18-
* @deprecated
19-
* Since version 2.1.2 this decorator is deprecated. Use @UseFilters() instead.
20-
*/
21-
export const ExceptionFilters = (...filters: ExceptionFilter[]) => {
22-
const logger = new Logger('ExceptionFilters');
23-
logger.warn('DEPRECATED! Since version 2.1.2 `@ExceptionFilters()` decorator is deprecated. Use `@UseFilters()` instead.');
24-
return defineFiltersMetadata(...filters);
25-
};
26-
2717
/**
2818
* Setups exception filters to the chosen context.
2919
* When the `@UseFilters()` is used on the controller level:

0 commit comments

Comments
 (0)