Files
TSinjex/src/interfaces/Exceptions.ts
Max P 3dbbfc8e1e Rename DIContainer to TSInjex and refactor interfaces
- Renamed DIContainer class and related references to TSInjex to better indicate its purpose as a TypeScript-based dependency injection container.
- Extracted IDependency interface to a separate file to improve modularity.
- Split the ITSInjex interface into ITSInjexRegister and ITSInjexResolve, then extended them in a new ITSInjex interface to clarify the separation of concerns.
- Updated tests and decorators to reflect the renaming and interface changes.
- Adjusted helper, functions, and index export to align with the new TSInjex structure.
2024-08-14 20:23:02 +02:00

31 lines
821 B
TypeScript

import { ITSInjex } from './ITSInjex';
/**
* General error class for {@link ITSInjex} interface.
*/
export class TSInjexError extends Error {
/**
* Creates a new instance of {@link TSInjexError}
* @param message **The error message**
*/
constructor(message: string) {
super(message);
this.name = 'TSInjex';
}
}
/**
* Error class for dependency resolution errors in {@link ITSInjex}.
* @see {@link ITSInjex.resolve}
*/
export class DependencyResolutionError extends TSInjexError {
/**
* Creates a new instance of {@link DependencyResolutionError}
* @param identifier **The identifier of the dependency**
*/
constructor(identifier: string) {
super(`Dependency ${identifier} not found.`);
this.name = 'TSInjexResolutionError';
}
}