From f18d6fb944448c01734f409470072a3dfda2db47 Mon Sep 17 00:00:00 2001 From: Rory& Date: Tue, 3 Jun 2025 19:09:31 +0200 Subject: Clean up pointless error handling, coerce booleans to string in nix --- flake.nix | 8 ++++---- src/dto/auth/RegisterDto.js | 11 +---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index b70d0b2..e82caa8 100644 --- a/flake.nix +++ b/flake.nix @@ -139,12 +139,12 @@ ]; requires = [ "mongodb.service" ]; environment = { - PORT = cfg.port; - LOG_REQUESTS = cfg.logRequests; + PORT = toString cfg.port; DATABASE_SECRET_PATH = "/run/credentials/safensound.service/mongodb"; JWT_SECRET_PATH = cfg.jwtSecretPath; - LOG_QUERIES = cfg.logQueries; - LOG_AUTH = cfg.logAuth; + LOG_AUTH = lib.boolToString cfg.logAuth; + LOG_QUERIES = lib.boolToString cfg.logQueries; + LOG_REQUESTS = cfg.logRequests; }; serviceConfig = { Type = "simple"; diff --git a/src/dto/auth/RegisterDto.js b/src/dto/auth/RegisterDto.js index 40f1959..fa319b2 100644 --- a/src/dto/auth/RegisterDto.js +++ b/src/dto/auth/RegisterDto.js @@ -22,15 +22,6 @@ export class RegisterDto { } } - try { - return await RegisterDto.schema.validateAsync(obj); - } catch (e) { - console.log(e); - throw new SafeNSoundError({ - errCode: 'JOI_VALIDATION_ERROR', - message: e.message, - validation_details: e.details - }); - } + return await RegisterDto.schema.validateAsync(obj); } } -- cgit 1.5.1