@athenna/logger
Version:
The Athenna logging solution. Log in stdout, files and buckets.
22 lines (21 loc) • 832 B
JavaScript
/**
* @athenna/logger
*
* (c) João Lenon <lenon@athenna.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { Exception } from '@athenna/common';
import { DriverFactory } from '#src/factories/DriverFactory';
export class DriverExistException extends Exception {
constructor(driverName) {
const availableDrivers = DriverFactory.availableDrivers().join(', ');
super({
status: 500,
code: 'E_EXIST_DRIVER',
message: `The driver ${driverName} already exists in DriverFactory.`,
help: `Available drivers are: ${availableDrivers}. The name ${driverName} is already in use inside DriverFactory. Try using a different name for your driver implementation.`
});
}
}