/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/core/errors/exceptions/circular-dependency.exception.ts
10 строк
536 B
Kamil Myśliwiec
fix(core): throw on circular factories and custom providers
13 июл 2023, 13:57
Не верифицирован
13 июл 2023, 13:57
1fea632
Код
Авторство
О чём код?
import { RuntimeException } from './runtime.exception'; export class CircularDependencyException extends RuntimeException { constructor(context?: string) { const ctx = context ? ` inside ${context}` : ``; super( `A circular dependency has been detected${ctx}. Please, make sure that each side of a bidirectional relationships are decorated with "forwardRef()". Note that circular relationships between custom providers (e.g., factories) are not supported since functions cannot be called more than once.`, ); } }