Skip to content

Commit

Permalink
fix(log): Log validation information if command schema validation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Oct 10, 2024
1 parent 37374be commit 1354bf0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imap-core/lib/imap-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1354bf0

Please sign in to comment.