diff --git a/backend/UserConfig.ts b/backend/UserConfig.ts index a138c498..e7f6f99e 100644 --- a/backend/UserConfig.ts +++ b/backend/UserConfig.ts @@ -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'); diff --git a/backend/app.ts b/backend/app.ts index a78f9d7d..35754f12 100644 --- a/backend/app.ts +++ b/backend/app.ts @@ -53,7 +53,7 @@ async function main() { // Attempt to load user configuration const readUserConfig = (): Promise => 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