From 1354bf0c0508355f77d1fccf8877148513997b29 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 10 Oct 2024 11:41:22 +0300 Subject: [PATCH] fix(log): Log validation information if command schema validation fails --- imap-core/lib/imap-command.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imap-core/lib/imap-command.js b/imap-core/lib/imap-command.js index 14f21f75..1210eab0 100644 --- a/imap-core/lib/imap-command.js +++ b/imap-core/lib/imap-command.js @@ -385,6 +385,12 @@ class IMAPCommand { let err = new Error('Not enough arguments provided'); err.responseCode = 400; err.code = 'InvalidArguments'; + err.meta = { + validation_command: this.command, + validation_schema: JSON.stringify(schema || null).substring(0, 255), + validation_minArgs: minArgs, + validation_attributes: JSON.stringify(parsed.attributes || null).substring(0, 255) + }; return callback(err); }