Skip to content

Commit 1354bf0

Browse files
committed
fix(log): Log validation information if command schema validation fails
1 parent 37374be commit 1354bf0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

imap-core/lib/imap-command.js

+6
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ class IMAPCommand {
385385
let err = new Error('Not enough arguments provided');
386386
err.responseCode = 400;
387387
err.code = 'InvalidArguments';
388+
err.meta = {
389+
validation_command: this.command,
390+
validation_schema: JSON.stringify(schema || null).substring(0, 255),
391+
validation_minArgs: minArgs,
392+
validation_attributes: JSON.stringify(parsed.attributes || null).substring(0, 255)
393+
};
388394
return callback(err);
389395
}
390396

0 commit comments

Comments
 (0)