@secjs/utils
Version:
Utils functions and classes for Node.js
31 lines (27 loc) • 867 B
JavaScript
/**
* @secjs/utils
*
* (c) João Lenon <lenonSec7@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { Exception } from '#src/Helpers/Exception'
export class RecursiveConfigException extends Exception {
/**
* Creates a new instance of RecursiveConfigException.
*
* @param {string} filePath
* @param {string} configName
* @return {RecursiveConfigException}
*/
constructor(filePath, configName) {
const content = `Your configuration file ${filePath} is using Config.get() to an other configuration file that is using a Config.get('${configName}*'), creating an infinite recursive call.`
super(
content,
500,
'E_CONFIG_RECURSIVE',
`Remove the Config.get('${configName}') in the file ${filePath}`,
)
}
}