Skip to content
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

Richard/issue69 #70

Merged
merged 3 commits into from
Sep 10, 2021
Merged

Richard/issue69 #70

merged 3 commits into from
Sep 10, 2021

Conversation

chomosuke
Copy link
Owner

Printed error and allowed empty string on mongoose

@chomosuke chomosuke self-assigned this Sep 9, 2021
@chomosuke chomosuke added the bug Something isn't working label Sep 9, 2021
@chomosuke chomosuke added this to the Sprint 1 milestone Sep 9, 2021
@chomosuke chomosuke linked an issue Sep 9, 2021 that may be closed by this pull request
@@ -47,6 +47,8 @@ const errorHandler: ErrorRequestHandler = (err, _req, res, _next) => {
}

res.sendStatus(500);

console.log(err.stack);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use console.error to write out the error to stderr. Also write out all the information about the error, not just the stack.

Suggested change
console.log(err.stack);
console.error(err);

Copy link
Collaborator

@shangzhel shangzhel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@chomosuke chomosuke merged commit 51f3e34 into master Sep 10, 2021
@chomosuke chomosuke deleted the richard/issue69 branch September 10, 2021 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server does not accept empty string for mandatory field
2 participants