Files
lib/src/di/error/InvalidDependencyKeyError.ts

13 lines
437 B
TypeScript
Raw Normal View History

2021-06-02 22:36:25 -05:00
import {DependencyKey} from '../types'
2022-08-10 21:53:56 -05:00
import {ErrorWithContext} from '../../util'
2021-06-01 20:59:40 -05:00
/**
* Error thrown when a dependency key that has not been registered is passed to a resolver.
* @extends Error
*/
2022-08-10 21:53:56 -05:00
export class InvalidDependencyKeyError extends ErrorWithContext {
constructor(key: DependencyKey, context: {[key: string]: any} = {}) {
super(`No such dependency is registered with this container: ${key}`, context)
2021-06-01 20:59:40 -05:00
}
}