fix(config): Throw error when connection string not found

This commit is contained in:
dunak-debug committed 2022-01-01 23:37:59 +01:00
1 parent 8f7fc7bee7
commit af75f140ac
1 file changed
+2
+2
View File
@@ -2,6 +2,8 @@ import { createPool } from 'mysql2/promise';
import { mysql_connection_string, mysql_transaction_isolation_level, typeCast } from '../config.js';
const connectionString = (() => {
if (mysql_connection_string === '') throw new Error(`^1Missing mysql_connection_string in server.cfg! Refer to the documentation^0`);
if (mysql_connection_string.includes('mysql://')) return { uri: mysql_connection_string };
const options = mysql_connection_string