This commit is contained in:
Tutur33
2023-11-24 22:35:41 +01:00
parent 3c0b507a93
commit 7644b2a0f7
45165 changed files with 4803356 additions and 3 deletions
@@ -0,0 +1,8 @@
import { Exception } from '@poppinss/utils';
/**
* Raised when trying to inject a primitive value like "StringConstructor"
* to a class constructor or method
*/
export declare class InvalidInjectionException extends Exception {
static invoke(value: any, parentName: string, index: number): InvalidInjectionException;
}
@@ -0,0 +1,23 @@
"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;
@@ -0,0 +1,15 @@
import { Exception } from '@poppinss/utils';
/**
* Raised when unable to lookup a namespace
*/
export declare class IocLookupException extends Exception {
static lookupFailed(namespace: string): IocLookupException;
/**
* Invalid namespace type
*/
static invalidNamespace(): IocLookupException;
/**
* Fake is missing and yet resolved
*/
static missingFake(namespace: string): IocLookupException;
}
+33
View File
@@ -0,0 +1,33 @@
"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.IocLookupException = void 0;
const utils_1 = require("@poppinss/utils");
/**
* Raised when unable to lookup a namespace
*/
class IocLookupException extends utils_1.Exception {
static lookupFailed(namespace) {
return new this(`Cannot resolve "${namespace}" namespace from the IoC Container`, 500, 'E_IOC_LOOKUP_FAILED');
}
/**
* Invalid namespace type
*/
static invalidNamespace() {
return new this('"Ioc.lookup" accepts a namespace string or a lookup node', 500, 'E_INVALID_IOC_NAMESPACE');
}
/**
* Fake is missing and yet resolved
*/
static missingFake(namespace) {
return new this(`Cannot resolve fake for "${namespace}" namespace`, 500, 'E_MISSING_IOC_FAKE');
}
}
exports.IocLookupException = IocLookupException;