mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
feat: add initial api logging (#1494)
Improve API logging and error handling between client and server side.
This commit is contained in:
@ -120,7 +120,9 @@ export const createDocumentFromTemplate = async ({
|
||||
});
|
||||
|
||||
if (!template) {
|
||||
throw new AppError(AppErrorCode.NOT_FOUND, 'Template not found');
|
||||
throw new AppError(AppErrorCode.NOT_FOUND, {
|
||||
message: 'Template not found',
|
||||
});
|
||||
}
|
||||
|
||||
// Check that all the passed in recipient IDs can be associated with a template recipient.
|
||||
@ -130,10 +132,9 @@ export const createDocumentFromTemplate = async ({
|
||||
);
|
||||
|
||||
if (!foundRecipient) {
|
||||
throw new AppError(
|
||||
AppErrorCode.INVALID_BODY,
|
||||
`Recipient with ID ${recipient.id} not found in the template.`,
|
||||
);
|
||||
throw new AppError(AppErrorCode.INVALID_BODY, {
|
||||
message: `Recipient with ID ${recipient.id} not found in the template.`,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user