-
Notifications
You must be signed in to change notification settings - Fork 14
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
Send 400 bad request error for no user-id header in api request #1988
Conversation
req.logger.debug({ message: 'User Id is:', user_id }); | ||
if (!user_id) { | ||
const error = new Error(`User-Id header not found.`); | ||
(error as any).type = SERVER_ERROR.USER_NOT_FOUND; |
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.
well it's a bad request type, not really a user not found, the server has incomplete info to even try to find a user
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.
@danoswaltCL Yeah, I was also thinking to add a new ERROR type: MISSING_HEADER_USER_ID
. But, got an input from our playpower team to reuse existing one's. I know this is for logged in user data not found from DB. I will update this if the above type looks good to you.
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.
@danoswaltCL I was yet to push the commit with your requested change, just showed you that does this looks good. Will create another small PR for the same. |
This resolves #1987