fix: include extra recipient info in missing fields error msg (#2590)

This commit is contained in:
Catalin Pit
2026-03-10 03:17:24 +02:00
committed by GitHub
parent 4daec44550
commit ab69ee627b
@@ -159,10 +159,12 @@ export const sendDocument = async ({
);
if (recipientsWithMissingFields.length > 0) {
const missingRecipientIds = recipientsWithMissingFields.map((r) => r.id).join(', ');
const missingRecipientDescriptions = recipientsWithMissingFields
.map((r) => (r.name ? `${r.name} (${r.email}, id: ${r.id})` : `${r.email} (id: ${r.id})`))
.join(', ');
throw new AppError(AppErrorCode.INVALID_REQUEST, {
message: `The following recipients are missing required fields: ${missingRecipientIds}. Signers must have at least one signature field.`,
message: `The following recipients are missing required fields: ${missingRecipientDescriptions}. Signers must have at least one signature field.`,
});
}