-
Notifications
You must be signed in to change notification settings - Fork 4
[PB-4388]: feat/activate automatic tax when creating sub #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
| try { | ||
| const { id } = await paymentService.createOrGetCustomer( | ||
| const userExists = await paymentService.getCustomerIdByEmail(email).catch(() => null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming a NotFoundError is the only thing it may fail is risky and can have side-effects like duplicating customers silently (because if error -> user does not exist, then, it should be created) due to unexpected errors. It is advisable to check if it is a NotFound and then return null or else, let the error propagate or handle it appropiately
|
|
|
The tests seem to be failing @xabg2 |
|



Changes on this PR