How to prevent Server Error if no req body?
Hi I have this code:
If no json is passed in the body i get this error:
[ERROR] SyntaxError: Unexpected end of JSON input
Is there anyway to replace this with my own error message?
Like the one in my code ^ ?4 Replies
Use try catch and then return if it throws.
ok thanks
try catch ?