Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/webhooks/events/invoices/InvoiceCompletedHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ export class InvoiceCompletedHandler {
await this.tiersService.applyDriveFeatures(user, tierToApply, lifetimeMaxSpaceBytesToApply);
Logger.info(`Drive features applied for user ${user.uuid} with customerId ${customer.id}`);
} catch (error) {
Logger.error(`Failed to apply drive features for user ${user.uuid} with customerId ${customer.id}`, {
error: (error as Error).message,
});
Logger.error(
`Failed to apply drive features for user ${user.uuid} with customerId ${customer.id}. Error: ${(error as Error).message}`,
);
throw error;
}

Expand All @@ -386,9 +386,9 @@ export class InvoiceCompletedHandler {
await this.tiersService.applyVpnFeatures(user, tierToApply);
Logger.info(`VPN features applied for user ${user.uuid} with customerId ${customer.id}`);
} catch (error) {
Logger.error(`Failed to apply VPN features for user ${user.uuid} with customerId ${customer.id}`, {
error: (error as Error).message,
});
Logger.error(
`Failed to apply VPN features for user ${user.uuid} with customerId ${customer.id}. Error: ${(error as Error).message}`,
);
throw error;
}

Expand All @@ -397,9 +397,9 @@ export class InvoiceCompletedHandler {
await this.tiersService.applyMailFeatures(user, tierToApply);
Logger.info(`Mail features applied for user ${user.uuid} with customerId ${customer.id}`);
} catch (error) {
Logger.error(`Failed to apply Mail features for user ${user.uuid} with customerId ${customer.id}`, {
error: (error as Error).message,
});
Logger.error(
`Failed to apply Mail features for user ${user.uuid} with customerId ${customer.id}. Error: ${(error as Error).message}`,
);
throw error;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,7 @@ describe('Testing the handler when an invoice is completed', () => {
}),
).rejects.toThrow(mockedError);
expect(loggerSpy).toHaveBeenCalledWith(
`Failed to apply drive features for user ${mockedUser.uuid} with customerId ${mockedCustomer.id}`,
{
error: mockedError.message,
},
`Failed to apply drive features for user ${mockedUser.uuid} with customerId ${mockedCustomer.id}. Error: ${mockedError.message}`,
);
});

Expand Down Expand Up @@ -730,10 +727,7 @@ describe('Testing the handler when an invoice is completed', () => {
}),
).rejects.toThrow(mockedError);
expect(loggerSpy).toHaveBeenCalledWith(
`Failed to apply VPN features for user ${mockedUser.uuid} with customerId ${mockedCustomer.id}`,
{
error: mockedError.message,
},
`Failed to apply VPN features for user ${mockedUser.uuid} with customerId ${mockedCustomer.id}. Error: ${mockedError.message}`,
);
});
});
Expand Down
Loading