UNPKG

@adonisjs/fold

Version:

Dependency manager and IoC container for your next NodeJs application

24 lines (23 loc) 829 B
"use strict"; /* * @adonisjs/fold * * (c) Harminder Virk <virk@adonisjs.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.InvalidInjectionException = void 0; const utils_1 = require("@poppinss/utils"); /** * Raised when trying to inject a primitive value like "StringConstructor" * to a class constructor or method */ class InvalidInjectionException extends utils_1.Exception { static invoke(value, parentName, index) { const primitiveName = `{${value.name} Constructor}`; return new this(`Cannot inject "${primitiveName}" to "${parentName}" at position "${index + 1}"`); } } exports.InvalidInjectionException = InvalidInjectionException;