-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/add input validation #6
base: dev
Are you sure you want to change the base?
Conversation
ApiError error = new ApiError(); | ||
error.code = 500; | ||
error.status = HttpStatus.INTERNAL_SERVER_ERROR.toString(); | ||
error.message = "Uh oh! something went wrong processing your request. Please try again or advise the administrator."; | ||
error.message = exp.getMessage(); |
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.
I dont think we should show the customer intneral message. The previous approach was better. Also i added some code to log this exception since we are overriding it
error.status = HttpStatus.BAD_REQUEST.toString(); | ||
error.message = "Business has already been claimed. Please contact administrator for assistance."; | ||
error.status = HttpStatus.CONFLICT.toString(); | ||
error.message = exp.getMessage(); |
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.
Same comment lets not show user internal message.
private String businessId; | ||
@NotNull | ||
@NotEmpty | ||
private String email; | ||
private String phone; |
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.
Should we validate phone number?
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.
Please review the suggested changes
Added validation for API Input parameters. Please validate the impact to Stripe functionality.