feat: improved some error logs

pull/243/head
Josh Moore 1 year ago
parent b37436c4f2
commit 9e0088e155

@ -50,7 +50,7 @@ export class UserConfig {
const config = (typeof c === 'string' ? JSON.parse(c) : c) as UserConfiguration;
if (!Checkers.uploadsDir(config.uploadsDir)) throw new Error(`Unable to access uploads directory: ${config.uploadsDir}`);
if (!Checkers.idType(config.idType)) throw new Error('Invalid ID type');
if (!Checkers.idType(config.idType)) throw new Error(`Invalid ID type: ${config.idType}`);
if (!Checkers.idSize(config.idSize)) throw new Error('Invalid ID size');
if (!Checkers.gfySize(config.gfySize)) throw new Error('Invalid Gfy size');
if (!Checkers.maximumFileSize(config.maximumFileSize)) throw new Error('Invalid maximum file size');

@ -53,7 +53,7 @@ async function main() {
// Attempt to load user configuration
const readUserConfig = (): Promise<void> => new Promise((resolve) =>
UserConfig.readConfigFile().then(() => resolve(void 0)).catch((err) => (console.error(err), resolve(void 0))));
UserConfig.readConfigFile().then(() => resolve(void 0)).catch((err) => (err.code && err.code === 'ENOENT' ? {} : console.error(err), resolve(void 0))));
await readUserConfig();
// Set up Express

Loading…
Cancel
Save