Skip to content

Commit

Permalink
feat: improved some error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Moore committed Jul 13, 2023
1 parent b37436c commit 9e0088e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/UserConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion backend/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e0088e

Please sign in to comment.