Server writes the following error message in console:
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Validation failed. Invalid option for type. Expected: Option A, Option B".] {
code: 'ERR_UNHANDLED_REJECTION'
}
🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
New Issue Checklist
Issue Description
I have multiple fields to validate before saving an object. But in certain conditions, This causes server to crash
Steps to reproduce
Cloud Code:
Field
project
is a pointer to another class.send a save request with empty
project
field and an invalid string fortype
field (Anything other than "Option A" or "Option B").Actual Outcome
The client receives the response
Validation failed. Please specify data for project
. but also server crashes!Expected Outcome
The response can have either one of validation failed messages. but server should not crash.
Environment
Server
6.4.0
Windows
Local
Database
MongoDB
6.0.9
MongoDB Atlas
Client
Parse Dashboard v-5.3.0
Logs
Server writes the following error message in console: